pub struct Algorithm(/* private fields */);Expand description
Represents a specific AEAD algorithm.
Implementations§
Source§impl Algorithm
impl Algorithm
Sourcepub fn aes_128_gcm() -> Self
pub fn aes_128_gcm() -> Self
AES-128 in Galois Counter Mode (GCM).
This corresponds to EVP_aead_aes_128_gcm.
Sourcepub fn aes_256_gcm() -> Self
pub fn aes_256_gcm() -> Self
AES-256 in Galois Counter Mode (GCM).
This corresponds to EVP_aead_aes_256_gcm.
Sourcepub fn chacha20_poly1305() -> Self
pub fn chacha20_poly1305() -> Self
ChaCha20-Poly1305 as described in RFC 8439.
This corresponds to EVP_aead_chacha20_poly1305.
Sourcepub fn xchacha20_poly1305() -> Self
pub fn xchacha20_poly1305() -> Self
XChaCha20-Poly1305 with a 24-byte nonce.
This corresponds to EVP_aead_xchacha20_poly1305.
Sourcepub fn key_length(&self) -> usize
pub fn key_length(&self) -> usize
Returns the key length, in bytes, required by this algorithm.
This corresponds to EVP_AEAD_key_length.
Sourcepub fn max_overhead(&self) -> usize
pub fn max_overhead(&self) -> usize
Returns the maximum additional bytes produced when sealing.
This corresponds to EVP_AEAD_max_overhead.
Sourcepub fn max_tag_len(&self) -> usize
pub fn max_tag_len(&self) -> usize
Returns the maximum tag length for this algorithm.
This corresponds to EVP_AEAD_max_tag_len.
Sourcepub fn nonce_len(&self) -> usize
pub fn nonce_len(&self) -> usize
Returns the nonce length, in bytes, required by this algorithm.
This corresponds to EVP_AEAD_nonce_length.