aes_wrap.h revision 189251
1236415Sjhb/* 2283927Sjhb * AES-based functions 3236415Sjhb * 4236415Sjhb * - AES Key Wrap Algorithm (128-bit KEK) (RFC3394) 5236415Sjhb * - One-Key CBC MAC (OMAC1) hash with AES-128 6236415Sjhb * - AES-128 CTR mode encryption 7236415Sjhb * - AES-128 EAX mode encryption/decryption 8236415Sjhb * - AES-128 CBC 9236415Sjhb * 10236415Sjhb * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi> 11236415Sjhb * 12236415Sjhb * This program is free software; you can redistribute it and/or modify 13236415Sjhb * it under the terms of the GNU General Public License version 2 as 14236415Sjhb * published by the Free Software Foundation. 15236415Sjhb * 16236415Sjhb * Alternatively, this software may be distributed under the terms of BSD 17236415Sjhb * license. 18236415Sjhb * 19236415Sjhb * See README and COPYING for more details. 20236415Sjhb */ 21236415Sjhb 22236415Sjhb#ifndef AES_WRAP_H 23236415Sjhb#define AES_WRAP_H 24236415Sjhb 25236415Sjhbint __must_check aes_wrap(const u8 *kek, int n, const u8 *plain, u8 *cipher); 26236415Sjhbint __must_check aes_unwrap(const u8 *kek, int n, const u8 *cipher, u8 *plain); 27236415Sjhbint __must_check omac1_aes_128_vector(const u8 *key, size_t num_elem, 28236415Sjhb const u8 *addr[], const size_t *len, 29236415Sjhb u8 *mac); 30236415Sjhbint __must_check omac1_aes_128(const u8 *key, const u8 *data, size_t data_len, 31236415Sjhb u8 *mac); 32236415Sjhbint __must_check aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out); 33236415Sjhbint __must_check aes_128_ctr_encrypt(const u8 *key, const u8 *nonce, 34236415Sjhb u8 *data, size_t data_len); 35236415Sjhbint __must_check aes_128_eax_encrypt(const u8 *key, 36236415Sjhb const u8 *nonce, size_t nonce_len, 37236415Sjhb const u8 *hdr, size_t hdr_len, 38236415Sjhb u8 *data, size_t data_len, u8 *tag); 39236415Sjhbint __must_check aes_128_eax_decrypt(const u8 *key, 40236415Sjhb const u8 *nonce, size_t nonce_len, 41236415Sjhb const u8 *hdr, size_t hdr_len, 42236415Sjhb u8 *data, size_t data_len, const u8 *tag); 43236415Sjhbint __must_check aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, 44236415Sjhb size_t data_len); 45236415Sjhbint __must_check aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, 46236415Sjhb size_t data_len); 47236415Sjhb 48236415Sjhb#endif /* AES_WRAP_H */ 49236415Sjhb