]>
Commit | Line | Data |
---|---|---|
6fc6879b JM |
1 | /* |
2 | * AES-based functions | |
3 | * | |
eefec1e4 | 4 | * - AES Key Wrap Algorithm (RFC3394) |
30bff1d0 | 5 | * - One-Key CBC MAC (OMAC1) hash with AES-128 and AES-256 |
325a85be | 6 | * - AES-128/192/256 CTR mode encryption |
6fc6879b JM |
7 | * - AES-128 EAX mode encryption/decryption |
8 | * - AES-128 CBC | |
d140db6a | 9 | * - AES-GCM |
4bf39105 | 10 | * - AES-CCM |
6fc6879b | 11 | * |
1cd7a503 | 12 | * Copyright (c) 2003-2012, Jouni Malinen <j@w1.fi> |
6fc6879b | 13 | * |
0f3d578e JM |
14 | * This software may be distributed under the terms of the BSD license. |
15 | * See README for more details. | |
6fc6879b JM |
16 | */ |
17 | ||
18 | #ifndef AES_WRAP_H | |
19 | #define AES_WRAP_H | |
20 | ||
eefec1e4 JM |
21 | int __must_check aes_wrap(const u8 *kek, size_t kek_len, int n, const u8 *plain, |
22 | u8 *cipher); | |
23 | int __must_check aes_unwrap(const u8 *kek, size_t kek_len, int n, | |
24 | const u8 *cipher, u8 *plain); | |
30bff1d0 JM |
25 | int __must_check omac1_aes_vector(const u8 *key, size_t key_len, |
26 | size_t num_elem, const u8 *addr[], | |
27 | const size_t *len, u8 *mac); | |
6fc6879b JM |
28 | int __must_check omac1_aes_128_vector(const u8 *key, size_t num_elem, |
29 | const u8 *addr[], const size_t *len, | |
30 | u8 *mac); | |
31 | int __must_check omac1_aes_128(const u8 *key, const u8 *data, size_t data_len, | |
32 | u8 *mac); | |
30bff1d0 JM |
33 | int __must_check omac1_aes_256(const u8 *key, const u8 *data, size_t data_len, |
34 | u8 *mac); | |
6fc6879b | 35 | int __must_check aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out); |
325a85be JM |
36 | int __must_check aes_ctr_encrypt(const u8 *key, size_t key_len, const u8 *nonce, |
37 | u8 *data, size_t data_len); | |
6fc6879b JM |
38 | int __must_check aes_128_ctr_encrypt(const u8 *key, const u8 *nonce, |
39 | u8 *data, size_t data_len); | |
40 | int __must_check aes_128_eax_encrypt(const u8 *key, | |
41 | const u8 *nonce, size_t nonce_len, | |
42 | const u8 *hdr, size_t hdr_len, | |
43 | u8 *data, size_t data_len, u8 *tag); | |
44 | int __must_check aes_128_eax_decrypt(const u8 *key, | |
45 | const u8 *nonce, size_t nonce_len, | |
46 | const u8 *hdr, size_t hdr_len, | |
47 | u8 *data, size_t data_len, const u8 *tag); | |
48 | int __must_check aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, | |
49 | size_t data_len); | |
50 | int __must_check aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, | |
51 | size_t data_len); | |
d140db6a JM |
52 | int __must_check aes_gcm_ae(const u8 *key, size_t key_len, |
53 | const u8 *iv, size_t iv_len, | |
54 | const u8 *plain, size_t plain_len, | |
55 | const u8 *aad, size_t aad_len, | |
56 | u8 *crypt, u8 *tag); | |
57 | int __must_check aes_gcm_ad(const u8 *key, size_t key_len, | |
58 | const u8 *iv, size_t iv_len, | |
59 | const u8 *crypt, size_t crypt_len, | |
60 | const u8 *aad, size_t aad_len, const u8 *tag, | |
61 | u8 *plain); | |
77b2c812 JM |
62 | int __must_check aes_gmac(const u8 *key, size_t key_len, |
63 | const u8 *iv, size_t iv_len, | |
64 | const u8 *aad, size_t aad_len, u8 *tag); | |
4bf39105 JM |
65 | int __must_check aes_ccm_ae(const u8 *key, size_t key_len, const u8 *nonce, |
66 | size_t M, const u8 *plain, size_t plain_len, | |
67 | const u8 *aad, size_t aad_len, u8 *crypt, u8 *auth); | |
68 | int __must_check aes_ccm_ad(const u8 *key, size_t key_len, const u8 *nonce, | |
69 | size_t M, const u8 *crypt, size_t crypt_len, | |
70 | const u8 *aad, size_t aad_len, const u8 *auth, | |
71 | u8 *plain); | |
6fc6879b JM |
72 | |
73 | #endif /* AES_WRAP_H */ |