pub trait AeadWithMetadata: Aead {
// Required method
fn metadata(&self) -> &'static AeadMetadata;
// Provided methods
fn algorithm(&self) -> Algorithm { ... }
fn key_size(&self) -> usize { ... }
fn nonce_size(&self) -> usize { ... }
fn tag_size(&self) -> usize { ... }
fn security_level(&self) -> u32 { ... }
fn algorithm_name(&self) -> &'static str { ... }
fn algorithm_description(&self) -> &'static str { ... }
fn supports_semantic_decrypt(&self) -> bool { ... }
fn validate_key(&self, key: &AeadKey) -> Result<()> { ... }
fn validate_nonce(&self, nonce: &Nonce) -> Result<()> { ... }
fn validate_ciphertext_size(&self, ciphertext_size: usize) -> Result<()> { ... }
}Expand description
Trait for AEAD implementations that provide metadata
Required Methods§
Sourcefn metadata(&self) -> &'static AeadMetadata
fn metadata(&self) -> &'static AeadMetadata
Get the algorithm metadata
Provided Methods§
Sourcefn nonce_size(&self) -> usize
fn nonce_size(&self) -> usize
Get the nonce size in bytes
Sourcefn security_level(&self) -> u32
fn security_level(&self) -> u32
Get the security level
Sourcefn algorithm_name(&self) -> &'static str
fn algorithm_name(&self) -> &'static str
Get the algorithm name
Sourcefn algorithm_description(&self) -> &'static str
fn algorithm_description(&self) -> &'static str
Get the algorithm description
Sourcefn supports_semantic_decrypt(&self) -> bool
fn supports_semantic_decrypt(&self) -> bool
Whether this algorithm’s reference stack implements lib_q_core::AeadDecryptSemantic
(Layer B), per AeadMetadata::supports_semantic_decrypt.
Custom dyn AeadWithMetadata implementations that are not full algorithm facades should
override this to return false when they do not implement semantic decrypt.
Sourcefn validate_key(&self, key: &AeadKey) -> Result<()>
fn validate_key(&self, key: &AeadKey) -> Result<()>
Validate key size
Sourcefn validate_nonce(&self, nonce: &Nonce) -> Result<()>
fn validate_nonce(&self, nonce: &Nonce) -> Result<()>
Validate nonce size
Sourcefn validate_ciphertext_size(&self, ciphertext_size: usize) -> Result<()>
fn validate_ciphertext_size(&self, ciphertext_size: usize) -> Result<()>
Validate ciphertext size (must be at least tag size)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".