diff options
author | Huang Ying <ying.huang@intel.com> | 2009-01-09 01:25:50 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-02-18 03:48:05 -0500 |
commit | 07bf44f86989f5ed866510374fe761d1903681fb (patch) | |
tree | b7a4bbd3a66dd6fec0243a12f8569a4ad0fce9da /arch/x86/crypto/aes_glue.c | |
parent | 109568e110ed67d4be1b28609b9fa00fca97f8eb (diff) |
crypto: aes - Export x86 AES encrypt/decrypt functions
Intel AES-NI AES acceleration instructions touch XMM state, to use
that in soft_irq context, general x86 AES implementation is used as
fallback. The first parameter is changed from struct crypto_tfm * to
struct crypto_aes_ctx * to make it easier to deal with 16 bytes
alignment requirement of AES-NI implementation.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/x86/crypto/aes_glue.c')
-rw-r--r-- | arch/x86/crypto/aes_glue.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/x86/crypto/aes_glue.c b/arch/x86/crypto/aes_glue.c index 71f457827116..49ae9fe32b22 100644 --- a/arch/x86/crypto/aes_glue.c +++ b/arch/x86/crypto/aes_glue.c | |||
@@ -5,17 +5,29 @@ | |||
5 | 5 | ||
6 | #include <crypto/aes.h> | 6 | #include <crypto/aes.h> |
7 | 7 | ||
8 | asmlinkage void aes_enc_blk(struct crypto_tfm *tfm, u8 *out, const u8 *in); | 8 | asmlinkage void aes_enc_blk(struct crypto_aes_ctx *ctx, u8 *out, const u8 *in); |
9 | asmlinkage void aes_dec_blk(struct crypto_tfm *tfm, u8 *out, const u8 *in); | 9 | asmlinkage void aes_dec_blk(struct crypto_aes_ctx *ctx, u8 *out, const u8 *in); |
10 | |||
11 | void crypto_aes_encrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src) | ||
12 | { | ||
13 | aes_enc_blk(ctx, dst, src); | ||
14 | } | ||
15 | EXPORT_SYMBOL_GPL(crypto_aes_encrypt_x86); | ||
16 | |||
17 | void crypto_aes_decrypt_x86(struct crypto_aes_ctx *ctx, u8 *dst, const u8 *src) | ||
18 | { | ||
19 | aes_dec_blk(ctx, dst, src); | ||
20 | } | ||
21 | EXPORT_SYMBOL_GPL(crypto_aes_decrypt_x86); | ||
10 | 22 | ||
11 | static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) | 23 | static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) |
12 | { | 24 | { |
13 | aes_enc_blk(tfm, dst, src); | 25 | aes_enc_blk(crypto_tfm_ctx(tfm), dst, src); |
14 | } | 26 | } |
15 | 27 | ||
16 | static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) | 28 | static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) |
17 | { | 29 | { |
18 | aes_dec_blk(tfm, dst, src); | 30 | aes_dec_blk(crypto_tfm_ctx(tfm), dst, src); |
19 | } | 31 | } |
20 | 32 | ||
21 | static struct crypto_alg aes_alg = { | 33 | static struct crypto_alg aes_alg = { |