/*1* Modified to interface to the Linux kernel2* Copyright (c) 2009, Intel Corporation.3*4* This program is free software; you can redistribute it and/or modify it5* under the terms and conditions of the GNU General Public License,6* version 2, as published by the Free Software Foundation.7*8* This program is distributed in the hope it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13* You should have received a copy of the GNU General Public License along with14* this program; if not, write to the Free Software Foundation, Inc., 59 Temple15* Place - Suite 330, Boston, MA 02111-1307 USA.16*/1718#ifndef __CRYPTO_VMAC_H19#define __CRYPTO_VMAC_H2021/* --------------------------------------------------------------------------22* VMAC and VHASH Implementation by Ted Krovetz ([email protected]) and Wei Dai.23* This implementation is herby placed in the public domain.24* The authors offers no warranty. Use at your own risk.25* Please send bug reports to the authors.26* Last modified: 17 APR 08, 1700 PDT27* ----------------------------------------------------------------------- */2829/*30* User definable settings.31*/32#define VMAC_TAG_LEN 6433#define VMAC_KEY_SIZE 128/* Must be 128, 192 or 256 */34#define VMAC_KEY_LEN (VMAC_KEY_SIZE/8)35#define VMAC_NHBYTES 128/* Must 2^i for any 3 < i < 13 Standard = 128*/3637/*38* This implementation uses u32 and u64 as names for unsigned 32-39* and 64-bit integer types. These are defined in C99 stdint.h. The40* following may need adaptation if you are not running a C99 or41* Microsoft C environment.42*/43struct vmac_ctx {44u64 nhkey[(VMAC_NHBYTES/8)+2*(VMAC_TAG_LEN/64-1)];45u64 polykey[2*VMAC_TAG_LEN/64];46u64 l3key[2*VMAC_TAG_LEN/64];47u64 polytmp[2*VMAC_TAG_LEN/64];48u64 cached_nonce[2];49u64 cached_aes[2];50int first_block_processed;51};5253typedef u64 vmac_t;5455struct vmac_ctx_t {56struct crypto_cipher *child;57struct vmac_ctx __vmac_ctx;58};5960#endif /* __CRYPTO_VMAC_H */616263