ica_des_cmac_intermediate
Purpose
Authenticate data or verify the authenticity of data with a DES key using the Block Cipher Based Message Authentication Code (CMAC) mode, as described in NIST Special Publication 800-38B. ica_des_cmac_intermediate and ica_des_cmac_last can be used when the message to be authenticated or to be verified using CMAC is supplied in multiple chunks. ica_des_cmac_intermediate is used to process all but the last chunk. All message chunks to be processed by ica_des_cmac_intermediate must have a size that is a multiple of the cipher block size (8 bytes for DES).
Note that ica_des_cmac_intermediate has no direction argument. This function can be used during authentication and during authenticity verification.
Format
unsigned int ica_des_cmac_intermediate(const unsigned char *message,
unsigned long message_length,
const unsigned char *key,
unsigned char *iv); Required hardware support
KMAC-DEA
Parameters
- const unsigned char *message
- Pointer to a readable buffer of size greater than or equal to message_length bytes. This buffer contains a non-final part of a message to be authenticated, or of which the authenticity is to be verified.
- unsigned long message_length
- Length in bytes of the message part in message. This value must be a multiple of the cipher block size.
- const unsigned char *key
- Pointer to a valid DES key of 8 bytes in length.
- unsigned char *iv
- Pointer to a valid initialization vector of cipher block size bytes (8 bytes for DES). For the first message part, this parameter must be set to a string of zeros. For processing the n-th message part, this parameter must be the resulting iv value of the ica_des_cmac_intermediate function applied to the (n-1)-th message part. This vector is overwritten during the function. The result value in iv can be used as the initialization vector for a chained call to ica_des_cmac_initermediate, or to ica_des_cmac_last with the same key.
Return codes
- 0
- Success
For return codes indicating exceptions, see Return codes.