(self)
| 408 | suite.decrypt(ciphertext, sk_r, info=b"different info") |
| 409 | |
| 410 | def test_ciphertext_format(self): |
| 411 | suite = Suite(KEM.X25519, KDF.HKDF_SHA256, AEAD.AES_128_GCM) |
| 412 | |
| 413 | sk_r = x25519.X25519PrivateKey.generate() |
| 414 | pk_r = sk_r.public_key() |
| 415 | |
| 416 | ciphertext = suite.encrypt(b"test", pk_r) |
| 417 | |
| 418 | # ciphertext should be: enc (32 bytes) + ct (4 bytes pt + 16 bytes tag) |
| 419 | assert len(ciphertext) == X25519_ENC_LENGTH + 4 + 16 |
| 420 | |
| 421 | def test_ciphertext_format_p256(self): |
| 422 | suite = Suite(KEM.P256, KDF.HKDF_SHA256, AEAD.AES_128_GCM) |
nothing calls this directly
no test coverage detected