File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from cyphersyntax .handshake import (
2+ HandshakeConfirmation ,
3+ HandshakeOffer ,
4+ HandshakeResponse ,
5+ )
16from cyphersyntax .identity import Identity
27from cyphersyntax .session import AeadSuite , SessionFactory
38
@@ -13,14 +18,19 @@ def main() -> None:
1318 suite = AeadSuite .AES_GCM_SIV ,
1419 supplemental_secret = b"future-pq-kem-secret" ,
1520 )
21+ received_offer = HandshakeOffer .from_bytes (pending_alice .offer .to_bytes ())
1622 response , pending_bob = SessionFactory .responder (
1723 local_identity = bob ,
1824 remote_signing_public_key = alice .ed25519_public_bytes (),
19- offer = pending_alice . offer ,
25+ offer = received_offer ,
2026 supplemental_secret = b"future-pq-kem-secret" ,
2127 )
22- confirmation , alice_session = pending_alice .complete (response )
23- bob_session = pending_bob .complete (confirmation )
28+ received_response = HandshakeResponse .from_bytes (response .to_bytes ())
29+ confirmation , alice_session = pending_alice .complete (received_response )
30+ received_confirmation = HandshakeConfirmation .from_bytes (
31+ confirmation .to_bytes ()
32+ )
33+ bob_session = pending_bob .complete (received_confirmation )
2434
2535 packet = alice_session .encrypt (b"CypherSyntax demo message" )
2636 plaintext = bob_session .decrypt (packet )
You can’t perform that action at this time.
0 commit comments