2 AES-CMAC-128 (rfc 4493)
3 Copyright (C) Stefan Metzmacher 2012
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef LIB_CRYPTO_AES_CMAC_128_H
20 #define LIB_CRYPTO_AES_CMAC_128_H
22 struct aes_cmac_128_context
{
27 uint8_t K1
[AES_BLOCK_SIZE
];
28 uint8_t K2
[AES_BLOCK_SIZE
];
30 uint8_t L
[AES_BLOCK_SIZE
];
31 uint8_t X
[AES_BLOCK_SIZE
];
32 uint8_t Y
[AES_BLOCK_SIZE
];
34 uint8_t tmp
[AES_BLOCK_SIZE
];
36 uint8_t last
[AES_BLOCK_SIZE
];
40 void aes_cmac_128_init(struct aes_cmac_128_context
*ctx
,
41 const uint8_t K
[AES_BLOCK_SIZE
]);
42 void aes_cmac_128_update(struct aes_cmac_128_context
*ctx
,
43 const uint8_t *_msg
, size_t _msg_len
);
44 void aes_cmac_128_final(struct aes_cmac_128_context
*ctx
,
45 uint8_t T
[AES_BLOCK_SIZE
]);
47 #endif /* LIB_CRYPTO_AES_CMAC_128_H */