libcli/cldap: make use of samba_tevent_context_init()
[Samba/gebeck_regimport.git] / lib / crypto / aes_cmac_128.h
blob28117a06b3e6efa9af8a90a22b03cf9681cf9222
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 uint8_t K1[AES_BLOCK_SIZE];
26 uint8_t K2[AES_BLOCK_SIZE];
28 uint8_t X[AES_BLOCK_SIZE];
30 uint8_t last[AES_BLOCK_SIZE];
31 size_t last_len;
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]);
41 #endif /* LIB_CRYPTO_AES_CMAC_128_H */