pub fn sskdf_hmac(
algorithm: &'static SskdfHmacAlgorithm,
secret: &[u8],
info: &[u8],
salt: &[u8],
output: &mut [u8],
) -> Result<(), Unspecified>
Available on crate feature
unstable
only.Expand description
§Single-step Key Derivation Function using HMAC
This algorithm may be referred to as “Single-Step KDF” or “NIST Concatenation KDF” by other implementors.
§Input Validation and Defaults
output.len()
,secret.len()
,info.len()
each must be <= 2^30.- The default salt, an all zero byte string with length equal to the digest block length, is used
if
salt.len() == 0
. output.len() > 0 and
secret.len() > 0`
§Implementation Notes
This implementation adheres to the algorithm specified in Section 4 of the NIST Special Publication 800-56C Revision 2 published on August 2020. Using Option 2 for the auxiliary function H.
Specification is available at https://doi.org/10.6028/NIST.SP.800-56Cr2
§Errors
Unspecified
is returned if input validation fails or an unexpected error occurs.