![]() |
NHS31xx SW API
|
The MAC module provides a way to sign messages for message integrity verification. It is suitable for applications requiring a lightweight cryptographic mechanism.
This module can be used as
This module uses the Chaskey algorithm to generate a signature for a given 128-bit key and arbitrarily long messages.
Functions | |
void | Mac_Init (const uint32_t key[4]) |
void | Mac_Sign (const uint8_t *message, const unsigned int messageLength, uint8_t tag[16]) |
void Mac_Init | ( | const uint32_t | key[4] | ) |
Initialization of the keys used for signing.
key | : Encryption key |
void Mac_Sign | ( | const uint8_t * | message, |
const unsigned int | messageLength, | ||
uint8_t | tag[16] | ||
) |
Signs a message with the given keys.
message | : A pointer to the message to be sent. | |
messageLength | : The length of the message in bytes. Padding is automatically added when needed, i.e. only when the message length is not a multiple of 16. For example, when messageLength equals 12, these padding bytes are used during signing: 04h 00h 00h 00h | |
[out] | tag | : A 16-byte array where the message hash will be stored. |