(self)
| 382 | suite.decrypt(ciphertext, secp384r1_sk) |
| 383 | |
| 384 | def test_wrong_aad_fails(self): |
| 385 | suite = Suite(KEM.X25519, KDF.HKDF_SHA256, AEAD.AES_128_GCM) |
| 386 | |
| 387 | sk_r = x25519.X25519PrivateKey.generate() |
| 388 | pk_r = sk_r.public_key() |
| 389 | |
| 390 | ciphertext = rust_openssl.hpke._encrypt_with_aad( |
| 391 | suite, b"Secret message", pk_r, aad=b"correct aad" |
| 392 | ) |
| 393 | |
| 394 | with pytest.raises(InvalidTag): |
| 395 | rust_openssl.hpke._decrypt_with_aad( |
| 396 | suite, ciphertext, sk_r, aad=b"wrong aad" |
| 397 | ) |
| 398 | |
| 399 | def test_info_mismatch_fails(self): |
| 400 | suite = Suite(KEM.X25519, KDF.HKDF_SHA256, AEAD.AES_128_GCM) |
nothing calls this directly
no test coverage detected