Closed FlareXes closed 11 months ago
@FlareXes The line shared_secret_A, encapsulated_key_A = kyber_A.encap_secret(public_key_B)
should have its results flipped, i.e. encapsulated_key_A, shared_secret_A = kyber_A.encap_secret(public_key_B)
. Also, there's no need for the line public_key_A, private_key_A = kyber_A.generate_keypair(), kyber_A.export_secret_key()
.
Please take a look here for a full example: https://github.com/open-quantum-safe/liboqs-python/blob/main/examples/kem.py.
Key Exchange Issue with Kyber-1024 in Python
I am encountering an issue while implementing the Kyber-1024 key encapsulation mechanism in my Python project. The shared secret keys between two parties do not seem to match. I have provided a simplified version of the code below:
Output:
Any help would be highly appreciated. Thank you!