pub struct AeadMetadata {
pub algorithm: Algorithm,
pub key_size: usize,
pub nonce_size: usize,
pub tag_size: usize,
pub security_level: u32,
pub name: &'static str,
pub description: &'static str,
pub supports_semantic_decrypt: bool,
}Expand description
Metadata for AEAD algorithms
Fields§
§algorithm: AlgorithmThe algorithm identifier
key_size: usizeKey size in bytes
nonce_size: usizeNonce size in bytes
tag_size: usizeAuthentication tag size in bytes
security_level: u32Security level (1, 3, 4, 5)
name: &'static strHuman-readable algorithm name
description: &'static strAlgorithm description
supports_semantic_decrypt: boolWhether the canonical lib-q-aead / leaf types for this algorithm implement
lib_q_core::AeadDecryptSemantic (Layer B semantic decrypt).
This reflects the algorithm capability table, not runtime guarantees for arbitrary
dyn AeadWithMetadata test doubles; those may override AeadWithMetadata::supports_semantic_decrypt.
Implementations§
Source§impl AeadMetadata
impl AeadMetadata
Sourcepub const fn new(
algorithm: Algorithm,
key_size: usize,
nonce_size: usize,
tag_size: usize,
security_level: u32,
name: &'static str,
description: &'static str,
supports_semantic_decrypt: bool,
) -> Self
pub const fn new( algorithm: Algorithm, key_size: usize, nonce_size: usize, tag_size: usize, security_level: u32, name: &'static str, description: &'static str, supports_semantic_decrypt: bool, ) -> Self
Create new metadata.
supports_semantic_decrypt is explicit per static table row (rather than inferred) so
capability stays auditable next to the numeric sizes in get_metadata.
Sourcepub fn performance_tier(&self) -> PerformanceTier
pub fn performance_tier(&self) -> PerformanceTier
Get the performance tier for this algorithm
Sourcepub fn is_suitable_for_security_level(&self, required_level: u32) -> bool
pub fn is_suitable_for_security_level(&self, required_level: u32) -> bool
Check if this algorithm is suitable for the given security level
Sourcepub fn total_overhead(&self) -> usize
pub fn total_overhead(&self) -> usize
Get the total overhead (nonce + tag) for this algorithm
Sourcepub fn validate_key_size(&self, key_size: usize) -> bool
pub fn validate_key_size(&self, key_size: usize) -> bool
Validate key size
Sourcepub fn validate_nonce_size(&self, nonce_size: usize) -> bool
pub fn validate_nonce_size(&self, nonce_size: usize) -> bool
Validate nonce size
Sourcepub fn validate_tag_size(&self, tag_size: usize) -> bool
pub fn validate_tag_size(&self, tag_size: usize) -> bool
Validate tag size
Trait Implementations§
Source§impl Clone for AeadMetadata
impl Clone for AeadMetadata
Source§fn clone(&self) -> AeadMetadata
fn clone(&self) -> AeadMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AeadMetadata
impl Debug for AeadMetadata
Source§impl PartialEq for AeadMetadata
impl PartialEq for AeadMetadata
Source§fn eq(&self, other: &AeadMetadata) -> bool
fn eq(&self, other: &AeadMetadata) -> bool
self and other values to be equal, and is used by ==.