pub enum DomainSeparation<'a> {
None,
Context(&'a [u8]),
Prehashed {
alg: PreHashAlgorithm,
context: &'a [u8],
},
}Expand description
Domain separation context for FN-DSA / HashFN-DSA (FIPS 206 §6).
§Variants
-
None— Pure FN-DSA, no context string (ph_flag = 0x00, context length = 0). -
Context— Pure FN-DSA with an application context string (1–255 bytes,ph_flag = 0x00). -
Prehashed— HashFN-DSA mode (ph_flag = 0x01). The message is pre-hashed; the algorithm OID and optional context string are injected into the hash context.
§FIPS 206 Wire Format
For all variants the bytes injected into the hash context (after the 40-byte nonce) are:
- Pure:
ph_flag(0x00) || len(ctx) || ctx - Hashed:
ph_flag(0x01) || len(ctx) || ctx || OID || hash(msg)
The context string must not exceed 255 bytes; passing a longer
slice returns Err(FalconError::BadArgument).
Variants§
None
No context string (pure FN-DSA, empty context).
Context(&'a [u8])
Application context string — max 255 bytes, pure FN-DSA.
Prehashed
HashFN-DSA mode: pre-hash the message with alg, optionally
bind with context (max 255 bytes).
Fields
alg: PreHashAlgorithmPre-hash algorithm.
Trait Implementations§
Source§impl<'a> Clone for DomainSeparation<'a>
impl<'a> Clone for DomainSeparation<'a>
Source§fn clone(&self) -> DomainSeparation<'a>
fn clone(&self) -> DomainSeparation<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more