MAGMA
Cryptographic Library
Loading...
Searching...
No Matches
mac.c File Reference
#include "modes/mac.h"
Include dependency graph for mac.c:

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 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.

Function Documentation

◆ calc_additional_keys()

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.

Note
Using in function magma_mac
Parameters
K1_outputPointer to the output buffer for K1.
K2_outputPointer to the output buffer for K2.
keysExpanded iteration keys.
Returns
MAGMA_SUCCESS on success, error code otherwise.

◆ magma_mac()

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.

Parameters
keysExpanded iteration keys.
mac_sizeSize of the MAC in bytes.
inputPointer to the input data.
macPointer to the output MAC.
lengthLength of the input data in bytes.
Returns
MAGMA_SUCCESS on success, error code otherwise.