python/tests: move samba_tool_drs test to proper place
[amitay/samba.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         uint64_t __align;
26
27         uint8_t K1[AES_BLOCK_SIZE];
28         uint8_t K2[AES_BLOCK_SIZE];
29
30         uint8_t L[AES_BLOCK_SIZE];
31         uint8_t X[AES_BLOCK_SIZE];
32         uint8_t Y[AES_BLOCK_SIZE];
33
34         uint8_t tmp[AES_BLOCK_SIZE];
35
36         uint8_t last[AES_BLOCK_SIZE];
37         size_t last_len;
38 };
39
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]);
46
47 #endif /* LIB_CRYPTO_AES_CMAC_128_H */