Authenticated encryption with associated data #
Confidentiality and authenticity are computational and are not stated as laws. The laws are
correctness (decrypt_encrypt), fixed tag expansion (size_encrypt), and soundness
(decrypt_sound): decrypt only accepts ciphertexts that encrypt produces. Together they make
decrypt the partial inverse of encrypt (decrypt_eq_some_iff).
The nonce is an explicit argument; choosing unique nonces is the caller's responsibility.
Failure is Option so that no failure reason is reported.
- Key : Type
Opaque, so an implementation may carry a precomputed key schedule.
- name : String
- keySize : Nat
- nonceSize : Nat
- tagSize : Nat
- maxPlaintextSize : Nat
The largest plaintext, in bytes, for which the security claim holds. Not used by any law.
- maxADSize : Nat
The largest associated data, in bytes, for which the security claim holds.
- size_encrypt (k : self.Key) (n : Vector UInt8 self.nonceSize) (ad pt : ByteArray) : (self.encrypt k n ad pt).size = pt.size + self.tagSize
The tag is the only expansion.
- decrypt_encrypt (k : self.Key) (n : Vector UInt8 self.nonceSize) (ad pt : ByteArray) : self.decrypt k n ad (self.encrypt k n ad pt) = some pt
Correctness, unconditional on length limits.
- decrypt_sound (k : self.Key) (n : Vector UInt8 self.nonceSize) (ad ct pt : ByteArray) : self.decrypt k n ad ct = some pt → self.encrypt k n ad pt = ct
Soundness: only ciphertexts produced by
encryptunder the same key, nonce and associated data are accepted.
Instances For
Distinct ciphertexts cannot decrypt to the same plaintext under one key, nonce and associated data.
The identity cipher, showing the laws are satisfiable. Provides no security.
Equations
- One or more equations did not get rendered due to their size.