aes128_cmac.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Fundación Inria Chile
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
24 #include <stdio.h>
25 #include "crypto/ciphers.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 #define AES128_CMAC_BLOCK_SIZE 16
35 
39 typedef struct {
45  uint8_t M_last[AES128_CMAC_BLOCK_SIZE];
47  uint32_t M_n;
49 
61  const uint8_t *key, uint8_t key_size);
62 
72  const void *data, size_t len);
73 
80 void aes128_cmac_final(aes128_cmac_context_t *ctx, void *digest);
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
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:34
AES128_CMAC calculation context.
Definition: aes128_cmac.h:39
uint32_t M_n
last byte in last block
Definition: aes128_cmac.h:47
cipher_t aes128_ctx
AES128 context.
Definition: aes128_cmac.h:41
basic struct for using block ciphers contains the cipher interface and the context
Definition: ciphers.h:118