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-i586-asm_32.S | |
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-i586-asm_32.S')
-rw-r--r-- | arch/x86/crypto/aes-i586-asm_32.S | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/crypto/aes-i586-asm_32.S b/arch/x86/crypto/aes-i586-asm_32.S index 5252c3880177..b949ec2f9af4 100644 --- a/arch/x86/crypto/aes-i586-asm_32.S +++ b/arch/x86/crypto/aes-i586-asm_32.S | |||
@@ -41,14 +41,14 @@ | |||
41 | #define tlen 1024 // length of each of 4 'xor' arrays (256 32-bit words) | 41 | #define tlen 1024 // length of each of 4 'xor' arrays (256 32-bit words) |
42 | 42 | ||
43 | /* offsets to parameters with one register pushed onto stack */ | 43 | /* offsets to parameters with one register pushed onto stack */ |
44 | #define tfm 8 | 44 | #define ctx 8 |
45 | #define out_blk 12 | 45 | #define out_blk 12 |
46 | #define in_blk 16 | 46 | #define in_blk 16 |
47 | 47 | ||
48 | /* offsets in crypto_tfm structure */ | 48 | /* offsets in crypto_aes_ctx structure */ |
49 | #define klen (crypto_tfm_ctx_offset + 480) | 49 | #define klen (480) |
50 | #define ekey (crypto_tfm_ctx_offset + 0) | 50 | #define ekey (0) |
51 | #define dkey (crypto_tfm_ctx_offset + 240) | 51 | #define dkey (240) |
52 | 52 | ||
53 | // register mapping for encrypt and decrypt subroutines | 53 | // register mapping for encrypt and decrypt subroutines |
54 | 54 | ||
@@ -217,7 +217,7 @@ | |||
217 | do_col (table, r5,r0,r1,r4, r2,r3); /* idx=r5 */ | 217 | do_col (table, r5,r0,r1,r4, r2,r3); /* idx=r5 */ |
218 | 218 | ||
219 | // AES (Rijndael) Encryption Subroutine | 219 | // AES (Rijndael) Encryption Subroutine |
220 | /* void aes_enc_blk(struct crypto_tfm *tfm, u8 *out_blk, const u8 *in_blk) */ | 220 | /* void aes_enc_blk(struct crypto_aes_ctx *ctx, u8 *out_blk, const u8 *in_blk) */ |
221 | 221 | ||
222 | .global aes_enc_blk | 222 | .global aes_enc_blk |
223 | 223 | ||
@@ -228,7 +228,7 @@ | |||
228 | 228 | ||
229 | aes_enc_blk: | 229 | aes_enc_blk: |
230 | push %ebp | 230 | push %ebp |
231 | mov tfm(%esp),%ebp | 231 | mov ctx(%esp),%ebp |
232 | 232 | ||
233 | // CAUTION: the order and the values used in these assigns | 233 | // CAUTION: the order and the values used in these assigns |
234 | // rely on the register mappings | 234 | // rely on the register mappings |
@@ -292,7 +292,7 @@ aes_enc_blk: | |||
292 | ret | 292 | ret |
293 | 293 | ||
294 | // AES (Rijndael) Decryption Subroutine | 294 | // AES (Rijndael) Decryption Subroutine |
295 | /* void aes_dec_blk(struct crypto_tfm *tfm, u8 *out_blk, const u8 *in_blk) */ | 295 | /* void aes_dec_blk(struct crypto_aes_ctx *ctx, u8 *out_blk, const u8 *in_blk) */ |
296 | 296 | ||
297 | .global aes_dec_blk | 297 | .global aes_dec_blk |
298 | 298 | ||
@@ -303,7 +303,7 @@ aes_enc_blk: | |||
303 | 303 | ||
304 | aes_dec_blk: | 304 | aes_dec_blk: |
305 | push %ebp | 305 | push %ebp |
306 | mov tfm(%esp),%ebp | 306 | mov ctx(%esp),%ebp |
307 | 307 | ||
308 | // CAUTION: the order and the values used in these assigns | 308 | // CAUTION: the order and the values used in these assigns |
309 | // rely on the register mappings | 309 | // rely on the register mappings |