lib/crypto: sync AES_cfb8_encrypt() from heimdal
[Samba.git] / lib / crypto / aes_cmac_128.h
blob9bcf951171c2334e1f8e80b80e8459db2888e5e5
1 /*
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 {
23 AES_KEY aes_key;
25 uint64_t __align;
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];
37 size_t last_len;
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 */