aes128_cmac.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2016 Fundación Inria Chile
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
21 #include <stdio.h>
22 #include "crypto/ciphers.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
31 #define AES128_CMAC_BLOCK_SIZE 16
32 
36 typedef struct {
42  uint8_t M_last[AES128_CMAC_BLOCK_SIZE];
44  uint32_t M_n;
46 
58  const uint8_t *key, uint8_t key_size);
59 
69  const void *data, size_t len);
70 
77 void aes128_cmac_final(aes128_cmac_context_t *ctx, void *digest);
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
Headers for the packet encryption class.
int aes128_cmac_init(aes128_cmac_context_t *ctx, const uint8_t *key, uint8_t key_size)
Initialize AES128 CMAC message digest context.
void aes128_cmac_final(aes128_cmac_context_t *ctx, void *digest)
Finalizes the CMAC message digest.
void aes128_cmac_update(aes128_cmac_context_t *ctx, const void *data, size_t len)
Update the AES128 CMAC context with a portion of the message being hashed.
#define AES128_CMAC_BLOCK_SIZE
Length of AES128_CMAC block in bytes.
Definition: aes128_cmac.h:31
AES128_CMAC calculation context.
Definition: aes128_cmac.h:36
uint32_t M_n
last byte in last block
Definition: aes128_cmac.h:44
cipher_t aes128_ctx
AES128 context.
Definition: aes128_cmac.h:38
basic struct for using block ciphers contains the cipher interface and the context
Definition: ciphers.h:115