File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from cyphersyntax .identity import Identity
2- from cyphersyntax .session import SessionFactory , AeadSuite
2+ from cyphersyntax .session import AeadSuite , SessionFactory
33
44
55def main () -> None :
66 alice = Identity .generate ("alice" )
77 bob = Identity .generate ("bob" )
8- alice_session , bob_session = SessionFactory .pair_for_tests (
9- alice = alice ,
10- bob = bob ,
8+
9+ pending_alice = SessionFactory .initiator (
10+ local_identity = alice ,
11+ remote_name = bob .name ,
1112 suite = AeadSuite .AES_GCM_SIV ,
1213 supplemental_secret = b"future-pq-kem-secret" ,
1314 )
15+ response , bob_session = SessionFactory .responder (
16+ local_identity = bob ,
17+ offer = pending_alice .offer ,
18+ supplemental_secret = b"future-pq-kem-secret" ,
19+ )
20+ alice_session = pending_alice .complete (response )
21+
1422 packet = alice_session .encrypt (b"CypherSyntax demo message" )
1523 plaintext = bob_session .decrypt (packet )
1624 print (plaintext .decode ("utf-8" ))
You can’t perform that action at this time.
0 commit comments