1189251Ssam/* 2189251Ssam * AES-based functions 3189251Ssam * 4189251Ssam * - AES Key Wrap Algorithm (128-bit KEK) (RFC3394) 5189251Ssam * - One-Key CBC MAC (OMAC1) hash with AES-128 6189251Ssam * - AES-128 CTR mode encryption 7189251Ssam * - AES-128 EAX mode encryption/decryption 8189251Ssam * - AES-128 CBC 9189251Ssam * 10189251Ssam * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi> 11189251Ssam * 12189251Ssam * This program is free software; you can redistribute it and/or modify 13189251Ssam * it under the terms of the GNU General Public License version 2 as 14189251Ssam * published by the Free Software Foundation. 15189251Ssam * 16189251Ssam * Alternatively, this software may be distributed under the terms of BSD 17189251Ssam * license. 18189251Ssam * 19189251Ssam * See README and COPYING for more details. 20189251Ssam */ 21189251Ssam 22189251Ssam#ifndef AES_WRAP_H 23189251Ssam#define AES_WRAP_H 24189251Ssam 25189251Ssamint __must_check aes_wrap(const u8 *kek, int n, const u8 *plain, u8 *cipher); 26189251Ssamint __must_check aes_unwrap(const u8 *kek, int n, const u8 *cipher, u8 *plain); 27189251Ssamint __must_check omac1_aes_128_vector(const u8 *key, size_t num_elem, 28189251Ssam const u8 *addr[], const size_t *len, 29189251Ssam u8 *mac); 30189251Ssamint __must_check omac1_aes_128(const u8 *key, const u8 *data, size_t data_len, 31189251Ssam u8 *mac); 32189251Ssamint __must_check aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out); 33189251Ssamint __must_check aes_128_ctr_encrypt(const u8 *key, const u8 *nonce, 34189251Ssam u8 *data, size_t data_len); 35189251Ssamint __must_check aes_128_eax_encrypt(const u8 *key, 36189251Ssam const u8 *nonce, size_t nonce_len, 37189251Ssam const u8 *hdr, size_t hdr_len, 38189251Ssam u8 *data, size_t data_len, u8 *tag); 39189251Ssamint __must_check aes_128_eax_decrypt(const u8 *key, 40189251Ssam const u8 *nonce, size_t nonce_len, 41189251Ssam const u8 *hdr, size_t hdr_len, 42189251Ssam u8 *data, size_t data_len, const u8 *tag); 43189251Ssamint __must_check aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, 44189251Ssam size_t data_len); 45189251Ssamint __must_check aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, 46189251Ssam size_t data_len); 47189251Ssam 48189251Ssam#endif /* AES_WRAP_H */ 49