pub struct Kmac128 { /* private fields */ }Expand description
SP 800-185 KMAC128, offering 128-bit security.
Implementations§
Source§impl Kmac128
impl Kmac128
Sourcepub fn new(key: &[u8], custom: &[u8]) -> Self
pub fn new(key: &[u8], custom: &[u8]) -> Self
Start a KMAC with key and a customization string.
Pass an empty custom when the key has only one use.
Sourcepub fn finalize(self, out: &mut [u8])
pub fn finalize(self, out: &mut [u8])
Produce a tag of exactly out.len() bytes.
The length is bound into the computation, so tags of different lengths over the same input are unrelated.
Sourcepub fn finalize_xof(self, out: &mut [u8])
pub fn finalize_xof(self, out: &mut [u8])
Produce an arbitrary-length stream instead of a fixed tag.
Encodes a length of zero, per SP 800-185 section 4.3.1.
Trait Implementations§
Source§impl SelfTest for Kmac128
impl SelfTest for Kmac128
Source§fn self_test() -> Result<()>
fn self_test() -> Result<()>
§Provenance
No pinned vector. The unit tests check KMAC against an independent construction from SP 800-185’s own definition — stronger evidence than a value this code produced — and cSHAKE beneath it is checked against a Keccak written from FIPS 202. docs/FIPS.md records that. What this adds at startup is that the code still computes what it computed when those tests last ran, and that its structural properties hold.