We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 622f6dd commit 1e589b2Copy full SHA for 1e589b2
tests/test_kem.py
@@ -36,8 +36,13 @@ def check_wrong_ciphertext(alg_name):
36
public_key = kem.generate_keypair()
37
ciphertext, shared_secret_server = kem.encap_secret(public_key)
38
wrong_ciphertext = bytes(random.getrandbits(8) for _ in range(len(ciphertext)))
39
- shared_secret_client = kem.decap_secret(wrong_ciphertext)
40
- assert shared_secret_client != shared_secret_server
+ try:
+ shared_secret_client = kem.decap_secret(wrong_ciphertext)
41
+ assert shared_secret_client != shared_secret_server
42
+ except RuntimeError:
43
+ pass
44
+ except Exception as ex:
45
+ raise AssertionError("An unexpected exception was raised. " + ex)
46
47
48
def test_not_supported():
0 commit comments