pub fn kbkdf_ctr_hmac(
algorithm: &'static KbkdfCtrHmacAlgorithm,
secret: &[u8],
info: &[u8],
output: &mut [u8],
) -> Result<(), Unspecified>
Available on crate feature
unstable
only.Expand description
§Key-based Key Derivation Function (KBKDF) in Counter Mode with HMAC PRF
§Input Validation and Defaults
output.len() > 0 and
secret.len() > 0`output.len() <= usize::MAX - DIGEST_LENGTH
- The requested
output.len()
would result in overflowing the counter.
§Implementation Notes
This implementation adheres to the algorithm specified in Section 4.1 of the NIST Special Publication 800-108 Revision 1 Update 1 published on August 2022. Using HMAC as the PRF function. In this implementation:
- The counter is 32-bits and is represented in big-endian format
- The counter is placed before the fixed info string
Specification available at https://doi.org/10.6028/NIST.SP.800-108r1-upd1
§Errors
Unspecified
is returned if input validation fails or an unexpected error occurs.