xref: /freebsd/sys/opencrypto/xform_cbc_mac.c (revision 42249ef2)
1 #include <sys/cdefs.h>
2 __FBSDID("$FreeBSD$");
3 
4 #include <opencrypto/cbc_mac.h>
5 #include <opencrypto/xform_auth.h>
6 
7 /* Authentication instances */
8 struct auth_hash auth_hash_ccm_cbc_mac_128 = {
9 	.type = CRYPTO_AES_CCM_CBC_MAC,
10 	.name = "CBC-CCM-AES-128",
11 	.keysize = AES_128_CBC_MAC_KEY_LEN,
12 	.hashsize = AES_CBC_MAC_HASH_LEN,
13 	.ctxsize = sizeof(struct aes_cbc_mac_ctx),
14 	.blocksize = CCM_CBC_BLOCK_LEN,
15 	.Init = (void (*)(void *)) AES_CBC_MAC_Init,
16 	.Setkey =
17 	    (void (*)(void *, const u_int8_t *, u_int16_t))AES_CBC_MAC_Setkey,
18 	.Reinit =
19 	    (void (*)(void *, const u_int8_t *, u_int16_t)) AES_CBC_MAC_Reinit,
20 	.Update =
21 	    (int  (*)(void *, const u_int8_t *, u_int16_t)) AES_CBC_MAC_Update,
22 	.Final = (void (*)(u_int8_t *, void *)) AES_CBC_MAC_Final,
23 };
24 struct auth_hash auth_hash_ccm_cbc_mac_192 = {
25 	.type = CRYPTO_AES_CCM_CBC_MAC,
26 	.name = "CBC-CCM-AES-192",
27 	.keysize = AES_192_CBC_MAC_KEY_LEN,
28 	.hashsize = AES_CBC_MAC_HASH_LEN,
29 	.ctxsize = sizeof(struct aes_cbc_mac_ctx),
30 	.blocksize = CCM_CBC_BLOCK_LEN,
31 	.Init = (void (*)(void *)) AES_CBC_MAC_Init,
32 	.Setkey =
33 	    (void (*)(void *, const u_int8_t *, u_int16_t)) AES_CBC_MAC_Setkey,
34 	.Reinit =
35 	    (void (*)(void *, const u_int8_t *, u_int16_t)) AES_CBC_MAC_Reinit,
36 	.Update =
37 	    (int  (*)(void *, const u_int8_t *, u_int16_t)) AES_CBC_MAC_Update,
38 	.Final = (void (*)(u_int8_t *, void *)) AES_CBC_MAC_Final,
39 };
40 struct auth_hash auth_hash_ccm_cbc_mac_256 = {
41 	.type = CRYPTO_AES_CCM_CBC_MAC,
42 	.name = "CBC-CCM-AES-256",
43 	.keysize = AES_256_CBC_MAC_KEY_LEN,
44 	.hashsize = AES_CBC_MAC_HASH_LEN,
45 	.ctxsize = sizeof(struct aes_cbc_mac_ctx),
46 	.blocksize = CCM_CBC_BLOCK_LEN,
47 	.Init = (void (*)(void *)) AES_CBC_MAC_Init,
48 	.Setkey =
49 	    (void (*)(void *, const u_int8_t *, u_int16_t)) AES_CBC_MAC_Setkey,
50 	.Reinit =
51 	    (void (*)(void *, const u_int8_t *, u_int16_t)) AES_CBC_MAC_Reinit,
52 	.Update =
53 	    (int  (*)(void *, const u_int8_t *, u_int16_t)) AES_CBC_MAC_Update,
54 	.Final = (void (*)(u_int8_t *, void *)) AES_CBC_MAC_Final,
55 };
56