aes_wrap.h revision 189261
198184Sgordon/* 298184Sgordon * AES-based functions 398184Sgordon * 498184Sgordon * - AES Key Wrap Algorithm (128-bit KEK) (RFC3394) 598184Sgordon * - One-Key CBC MAC (OMAC1) hash with AES-128 698184Sgordon * - AES-128 CTR mode encryption 798184Sgordon * - AES-128 EAX mode encryption/decryption 8140339Sobrien * - AES-128 CBC 9136224Smtm * 1098184Sgordon * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi> 1198184Sgordon * 1298184Sgordon * This program is free software; you can redistribute it and/or modify 1398184Sgordon * it under the terms of the GNU General Public License version 2 as 1498184Sgordon * published by the Free Software Foundation. 15104039Sgordon * 16124627Smtm * Alternatively, this software may be distributed under the terms of BSD 17165664Syar * license. 18165664Syar * 19165664Syar * See README and COPYING for more details. 20137112Smtm */ 2198184Sgordon 22137112Smtm#ifndef AES_WRAP_H 23137112Smtm#define AES_WRAP_H 24137112Smtm 25137112Smtmint __must_check aes_wrap(const u8 *kek, int n, const u8 *plain, u8 *cipher); 26158692Smatteoint __must_check aes_unwrap(const u8 *kek, int n, const u8 *cipher, u8 *plain); 27137112Smtmint __must_check omac1_aes_128_vector(const u8 *key, size_t num_elem, 28165664Syar const u8 *addr[], const size_t *len, 29165664Syar u8 *mac); 30137112Smtmint __must_check omac1_aes_128(const u8 *key, const u8 *data, size_t data_len, 31137112Smtm u8 *mac); 3298184Sgordonint __must_check aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out); 3398184Sgordonint __must_check aes_128_ctr_encrypt(const u8 *key, const u8 *nonce, 34137112Smtm u8 *data, size_t data_len); 3598184Sgordonint __must_check aes_128_eax_encrypt(const u8 *key, 36137112Smtm const u8 *nonce, size_t nonce_len, 37137112Smtm const u8 *hdr, size_t hdr_len, 38137112Smtm u8 *data, size_t data_len, u8 *tag); 39137112Smtmint __must_check aes_128_eax_decrypt(const u8 *key, 40137112Smtm const u8 *nonce, size_t nonce_len, 41137112Smtm const u8 *hdr, size_t hdr_len, 42137112Smtm u8 *data, size_t data_len, const u8 *tag); 43137112Smtmint __must_check aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, 44137112Smtm size_t data_len); 45137112Smtmint __must_check aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, 46137112Smtm size_t data_len); 47137112Smtm 48137112Smtm#endif /* AES_WRAP_H */ 49137112Smtm