Skip to main content

kmac128

Function kmac128 

Source
fn kmac128(
    key: &[u8],
    key_length: u32,
    message: &[u8],
    output_length: u32,
    customization: &[u8],
) -> Vec<u8> 
Expand description

The KMAC128 function defined in Section 4 of [NIST-SP800-185], using key as the K input parameter, message as the X input parameter, output_length as the L input parameter, and customization as the S input parameter, where key_length is the key length in bits. https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf

Since the key is represented as a byte sequence, and the key length in bits might not be a muliple of 8, callers need to provide the actual key length in bits via the function argument key_length, and the excess bits at the end of the byte sequence must be zeros.