|
MAGMA
Cryptographic Library
|
#include "modes/mac.h"
Functions | |
| MagmaResult | magma_mac (const unsigned char keys[ITER_KEYS_COUNT][ITER_KEY_LEN], const size_t mac_size, const unsigned char *input, unsigned char *mac, const size_t length) |
| Processing data to produce a Message Authentication Code (MAC) using the specified keys. | |
| MagmaResult | magma_mac_verify (const unsigned char keys[ITER_KEYS_COUNT][ITER_KEY_LEN], const size_t mac_size, const unsigned char *input, const unsigned char *mac, const size_t length, int *result) |
| Verifies a Message Authentication Code (MAC) in constant time. | |
| MagmaResult | calc_additional_keys (unsigned char K1_output[MAGMA_BLOCK_SIZE], unsigned char K2_output[MAGMA_BLOCK_SIZE], const unsigned char keys[ITER_KEYS_COUNT][ITER_KEY_LEN]) |
| Calculates additional keys K1 and K2 used in the MAC generation process. | |
| MagmaResult calc_additional_keys | ( | unsigned char | K1_output[MAGMA_BLOCK_SIZE], |
| unsigned char | K2_output[MAGMA_BLOCK_SIZE], | ||
| const unsigned char | keys[ITER_KEYS_COUNT][ITER_KEY_LEN] ) |
Calculates additional keys K1 and K2 used in the MAC generation process.
| K1_output | Pointer to the output buffer for K1. |
| K2_output | Pointer to the output buffer for K2. |
| keys | Expanded iteration keys. |
| MagmaResult magma_mac | ( | const unsigned char | keys[ITER_KEYS_COUNT][ITER_KEY_LEN], |
| const size_t | mac_size, | ||
| const unsigned char * | input, | ||
| unsigned char * | mac, | ||
| const size_t | length ) |
Processing data to produce a Message Authentication Code (MAC) using the specified keys.
| keys | Expanded iteration keys. |
| mac_size | Size of the MAC in bytes. |
| input | Pointer to the input data. |
| mac | Pointer to the output MAC. |
| length | Length of the input data in bytes. |
| MagmaResult magma_mac_verify | ( | const unsigned char | keys[ITER_KEYS_COUNT][ITER_KEY_LEN], |
| const size_t | mac_size, | ||
| const unsigned char * | input, | ||
| const unsigned char * | mac, | ||
| const size_t | length, | ||
| int * | result ) |
Verifies a Message Authentication Code (MAC) in constant time.
| keys | Expanded iteration keys. |
| mac_size | Size of the MAC in bytes. |
| input | Pointer to the input data. |
| mac | Pointer to the MAC to verify against. |
| length | Length of the input data in bytes. |
| result | Set to 1 if the MAC is valid, 0 otherwise. Only meaningful when MAGMA_SUCCESS is returned. |