ica_3des_cmac_intermediate
Purpose
Authenticate data or verify the authenticity of data with an 3DES key using the Block Cipher Based Message Authentication Code (CMAC) mode, as described in NIST Special Publication 800-38B. ica_3des_cmac_intermediate and ica_3des_cmac_last can be used when the message to be authenticated or to be verified using CMAC is supplied in multiple chunks. ica_3des_cmac_intermediate is used to process all but the last chunk. All message chunks to be processed by ica_3des_cmac_intermediate must have a size that is a multiple of the cipher block size (a multiple of 8 bytes for 3DES).
Note that ica_3des_cmac_intermediate has no direction argument. This function can be used during authentication and during authenticity verification.
Format
unsigned int ica_3des_cmac_intermediate(const unsigned char *message,
unsigned long message_length,
const unsigned char *key,
unsigned char *iv); Required hardware support
KMAC-TDEA-192
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 3DES key of 24 bytes in length.
- unsigned char *iv
- Pointer to a valid initialization vector of cipher block size (8 bytes for 3DES). 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_3des_cmac_intermediate 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_3des_cmac_initermediate or to ica_3des_cmac_last with the same key.
Return codes
- 0
- Success
For return codes indicating exceptions, see Return codes.