s3: piddir creation fix part 2.
[ira/wip.git] / lib / crypto / aes_cmac_128.h
1 /*
2    AES-CMAC-128 (rfc 4493)
3    Copyright (C) Stefan Metzmacher 2012
4
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.
9
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.
14
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/>.
17 */
18
19 #ifndef LIB_CRYPTO_AES_CMAC_128_H
20 #define LIB_CRYPTO_AES_CMAC_128_H
21
22 struct aes_cmac_128_context {
23         AES_KEY aes_key;
24
25         uint8_t K1[AES_BLOCK_SIZE];
26         uint8_t K2[AES_BLOCK_SIZE];
27
28         uint8_t X[AES_BLOCK_SIZE];
29
30         uint8_t last[AES_BLOCK_SIZE];
31         size_t last_len;
32 };
33
34 void aes_cmac_128_init(struct aes_cmac_128_context *ctx,
35                        const uint8_t K[AES_BLOCK_SIZE]);
36 void aes_cmac_128_update(struct aes_cmac_128_context *ctx,
37                          const uint8_t *_msg, size_t _msg_len);
38 void aes_cmac_128_final(struct aes_cmac_128_context *ctx,
39                         uint8_t T[AES_BLOCK_SIZE]);
40
41 #endif /* LIB_CRYPTO_AES_CMAC_128_H */