torture: smbtorture test case to verify Compound related handling
[Samba.git] / lib / crypto / aesni.h
blob13d09d2d67621dccd9a26413fa26bedd1db65643
1 /*
2 * Copyright (C) 2008, Intel Corp.
3 * Author: Huang Ying <ying.huang@intel.com>
4 * Vinodh Gopal <vinodh.gopal@intel.com>
5 * Kahraman Akdemir
7 * Ported x86_64 version to x86:
8 * Author: Mathias Krause <minipli@googlemail.com>
10 * Modified for use in Samba by Justin Maggard <jmaggard@netgear.com>
11 * and Jeremy Allison <jra@samba.org>
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
19 #ifndef LIB_CRYPTO_AESNI_H
20 #define LIB_CRYPTO_AESNI_H 1
22 #if defined(HAVE_AESNI_INTEL)
24 #define AES_MAX_KEYLENGTH (15 * 16)
25 #define AES_MAX_KEYLENGTH_U32 (AES_MAX_KEYLENGTH / sizeof(uint32_t))
28 * Please ensure that the first two fields are 16-byte aligned
29 * relative to the start of the structure, i.e., don't move them!
31 struct crypto_aes_ctx {
32 uint32_t key_enc[AES_MAX_KEYLENGTH_U32];
33 uint32_t key_dec[AES_MAX_KEYLENGTH_U32];
34 uint32_t key_length;
37 struct crypto_aesni_ctx {
38 uint8_t _acc_ctx[sizeof(struct crypto_aes_ctx) + 16];
39 struct crypto_aes_ctx *acc_ctx;
43 * These next 4 functions are actually implemented
44 * in the assembly language file:
45 * third_party/aesni-intel/aesni-intel_asm.c
48 int aesni_set_key(struct crypto_aes_ctx *ctx,
49 const uint8_t *in_key,
50 unsigned int key_len);
51 void aesni_enc(struct crypto_aes_ctx *ctx, uint8_t *dst, const uint8_t *src);
52 void aesni_dec(struct crypto_aes_ctx *ctx, uint8_t *dst, const uint8_t *src);
54 #else /* #if defined(HAVE_AESNI_INTEL) */
57 * We need a dummy definition of struct crypto_aesni_ctx to allow compiles.
60 struct crypto_aesni_ctx {
61 int dummy;
64 #endif /* #if defined(HAVE_AESNI_INTEL) */
66 #endif /* LIB_CRYPTO_AESNI_H */