Skip to content

Commit 176bdf7

Browse files
authored
Refactor session handling in demo.py
1 parent b45599e commit 176bdf7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎demo.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ def main() -> None:
99
pending_alice = SessionFactory.initiator(
1010
local_identity=alice,
1111
remote_name=bob.name,
12+
remote_signing_public_key=bob.ed25519_public_bytes(),
1213
suite=AeadSuite.AES_GCM_SIV,
1314
supplemental_secret=b"future-pq-kem-secret",
1415
)
15-
response, bob_session = SessionFactory.responder(
16+
response, pending_bob = SessionFactory.responder(
1617
local_identity=bob,
18+
remote_signing_public_key=alice.ed25519_public_bytes(),
1719
offer=pending_alice.offer,
1820
supplemental_secret=b"future-pq-kem-secret",
1921
)
20-
alice_session = pending_alice.complete(response)
22+
confirmation, alice_session = pending_alice.complete(response)
23+
bob_session = pending_bob.complete(confirmation)
2124

2225
packet = alice_session.encrypt(b"CypherSyntax demo message")
2326
plaintext = bob_session.decrypt(packet)

0 commit comments

Comments
 (0)