Expand description
§Authenticated Encryption (AEAD)
💡 This is a hacspec representation of the HPKE RFC. The text is mostly verbatim from the RFC with changes where required. It demonstrates the possibilities of hacspec for specifications.
Seal(key, nonce, aad, pt)
: Encrypt and authenticate plaintextpt
with associated dataaad
using symmetric keykey
and noncenonce
, yielding ciphertext and tagct
. This function can raise aMessageLimitReachedError
upon failure.Open(key, nonce, aad, ct)
: Decrypt ciphertext and tagct
using associated dataaad
with symmetric keykey
and noncenonce
, returning plaintext messagept
. This function can raise anOpenError
orMessageLimitReachedError
upon failure.Nk
: The length in bytes of a key for this algorithm.Nn
: The length in bytes of a nonce for this algorithm.Nt
: The length in bytes of the authentication tag for this algorithm.
§Security Requirements on an AEAD
All AEADs MUST be IND-CCA2-secure, as is currently true for all AEADs
listed in AEAD
.
Enums§
- AEAD
- Authenticated Encryption with Associated Data (AEAD) Functions
Functions§
- Aead
Open - Decrypt ciphertext and tag
ct
using associated dataaad
with symmetric keykey
and noncenonce
, returning plaintext messagept
. This function can raise anOpenError
orMessageLimitReachedError
upon failure. - Aead
Seal - Encrypt and authenticate plaintext
pt
with associated dataaad
using symmetric keykey
and noncenonce
, yielding ciphertext and tagct
. This function can raise aMessageLimitReachedError
upon failure. - Nk
- The length in bytes of a key for this algorithm.
- Nn
- The length in bytes of a nonce for this algorithm.
- Nt
- The length in bytes of the authentication tag for this algorithm.