]>
Commit | Line | Data |
---|---|---|
f3f84055 ML |
1 | /* |
2 | chronyd/chronyc - Programs for keeping computer clocks accurate. | |
3 | ||
4 | ********************************************************************** | |
5 | * Copyright (C) Miroslav Lichvar 2019 | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of version 2 of the GNU General Public License as | |
9 | * published by the Free Software Foundation. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, but | |
12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | * General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License along | |
17 | * with this program; if not, write to the Free Software Foundation, Inc., | |
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
19 | * | |
20 | ********************************************************************** | |
21 | ||
22 | ======================================================================= | |
23 | ||
24 | Header file for CMAC. | |
25 | ||
26 | */ | |
27 | ||
28 | #ifndef GOT_CMAC_H | |
29 | #define GOT_CMAC_H | |
30 | ||
972c476c ML |
31 | /* Avoid overlapping with the hash enumeration */ |
32 | typedef enum { | |
33 | CMC_INVALID = 0, | |
34 | CMC_AES128 = 13, | |
35 | CMC_AES256 = 14, | |
36 | } CMC_Algorithm; | |
37 | ||
f3f84055 ML |
38 | typedef struct CMC_Instance_Record *CMC_Instance; |
39 | ||
d93aa10b | 40 | extern int CMC_GetKeyLength(CMC_Algorithm algorithm); |
972c476c | 41 | extern CMC_Instance CMC_CreateInstance(CMC_Algorithm algorithm, const unsigned char *key, |
d93aa10b ML |
42 | int length); |
43 | extern int CMC_Hash(CMC_Instance inst, const void *in, int in_len, | |
44 | unsigned char *out, int out_len); | |
f3f84055 ML |
45 | extern void CMC_DestroyInstance(CMC_Instance inst); |
46 | ||
47 | #endif | |
48 |