SX126x-Arduino  2.0.1
Macros | Functions
cmac.cpp File Reference
#include <stdint.h>
#include "aes.h"
#include "cmac.h"
#include "system/utilities.h"

Macros

#define LSHIFT(v, r)
 
#define XOR(v, r)
 
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
 

Functions

void AES_CMAC_Init (AES_CMAC_CTX *ctx)
 
void AES_CMAC_SetKey (AES_CMAC_CTX *ctx, const uint8_t key[AES_CMAC_KEY_LENGTH])
 
void AES_CMAC_Update (AES_CMAC_CTX *ctx, const uint8_t *data, uint32_t len)
 
void AES_CMAC_Final (uint8_t digest[AES_CMAC_DIGEST_LENGTH], AES_CMAC_CTX *ctx)
 

Macro Definition Documentation

◆ LSHIFT

#define LSHIFT (   v,
 
)
Value:
do \
{ \
int32_t i; \
for (i = 0; i < 15; i++) \
(r)[i] = (v)[i] << 1 | (v)[i + 1] >> 7; \
(r)[15] = (v)[15] << 1; \
} while (0)

◆ XOR

#define XOR (   v,
 
)
Value:
do \
{ \
int32_t i; \
for (i = 0; i < 16; i++) \
{ \
(r)[i] = (r)[i] ^ (v)[i]; \
} \
} while (0)

◆ MIN

#define MIN (   a,
 
)    ((a) < (b) ? (a) : (b))

Function Documentation

◆ AES_CMAC_Init()

void AES_CMAC_Init ( AES_CMAC_CTX ctx)

◆ AES_CMAC_SetKey()

void AES_CMAC_SetKey ( AES_CMAC_CTX ctx,
const uint8_t  key[AES_CMAC_KEY_LENGTH] 
)

◆ AES_CMAC_Update()

void AES_CMAC_Update ( AES_CMAC_CTX ctx,
const uint8_t *  data,
uint32_t  len 
)

◆ AES_CMAC_Final()

void AES_CMAC_Final ( uint8_t  digest[AES_CMAC_DIGEST_LENGTH],
AES_CMAC_CTX ctx 
)