rok::core::crypto::aead
Authenticated encryption with associated data: AES-GCM (NIST SP 800-38D, 96-bit nonces) and ChaCha20-Poly1305 (RFC 8439). Tags are 16 bytes, appended to the ciphertext. The key material is in secret storage; per-message state is in locals.
Structs
Aead
pub struct AeadA key ready for seal / open.
pub fn new(alg: AeadAlgorithm, key: Bytes) throws (ValueError) -> Aeadpub const fn algorithm(self) -> AeadAlgorithmpub fn wipe(self)Overwrite the key material with zeros now (every copy shares it);
sealandopenare meaningless afterwards.pub fn seal(self, nonce: Bytes, aad: Bytes, plaintext: Bytes) throws (ValueError) -> List<u8>plaintextencrypted, then the tag.pub fn open(self, nonce: Bytes, aad: Bytes, ciphertext_and_tag: Bytes) throws (ValueError) -> List<u8> | noneThe plaintext, or
nonewhen the tag does not match (nothing is decrypted then).
Trait implementations 1
impl Drop for Aead
Enums
AeadAlgorithm
pub enum AeadAlgorithmAes128GcmAes256GcmChaCha20Poly1305pub const fn key_len(self) -> usizepub const fn nonce_len(self) -> usizepub const fn tag_len(self) -> usize