blob: afa1451e8dc07b9a5336dd8be13551ff04e1d783 [file] [log] [blame]
Harald Welte781bd5d2011-12-06 22:23:52 +01001/*
2 * AES-based functions
3 *
4 * - AES Key Wrap Algorithm (128-bit KEK) (RFC3394)
5 * - One-Key CBC MAC (OMAC1) hash with AES-128
6 * - AES-128 CTR mode encryption
7 * - AES-128 EAX mode encryption/decryption
8 * - AES-128 CBC
9 *
10 * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 *
16 * Alternatively, this software may be distributed under the terms of BSD
17 * license.
18 *
19 * See README and COPYING for more details.
20 */
21
Sylvain Munaut12ba7782014-06-16 10:13:40 +020022#pragma once
Harald Welte781bd5d2011-12-06 22:23:52 +010023
24int __must_check aes_wrap(const u8 *kek, int n, const u8 *plain, u8 *cipher);
25int __must_check aes_unwrap(const u8 *kek, int n, const u8 *cipher, u8 *plain);
26int __must_check omac1_aes_128_vector(const u8 *key, size_t num_elem,
27 const u8 *addr[], const size_t *len,
28 u8 *mac);
29int __must_check omac1_aes_128(const u8 *key, const u8 *data, size_t data_len,
30 u8 *mac);
31int __must_check aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out);
32int __must_check aes_128_ctr_encrypt(const u8 *key, const u8 *nonce,
33 u8 *data, size_t data_len);
34int __must_check aes_128_eax_encrypt(const u8 *key,
35 const u8 *nonce, size_t nonce_len,
36 const u8 *hdr, size_t hdr_len,
37 u8 *data, size_t data_len, u8 *tag);
38int __must_check aes_128_eax_decrypt(const u8 *key,
39 const u8 *nonce, size_t nonce_len,
40 const u8 *hdr, size_t hdr_len,
41 u8 *data, size_t data_len, const u8 *tag);
42int __must_check aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data,
43 size_t data_len);
44int __must_check aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data,
45 size_t data_len);