diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-06-02 00:42:25 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2006-06-26 09:34:42 +0200 |
commit | e90b1a2be6010acf01673b0625cfbf18240f7744 (patch) | |
tree | 7b99c136335b94bde40a6a260a6d823c83433024 /arch/x86_64/crypto | |
parent | [CRYPTO] tcrypt: Speed benchmark support for digest algorithms (diff) | |
download | linux-e90b1a2be6010acf01673b0625cfbf18240f7744.tar.xz linux-e90b1a2be6010acf01673b0625cfbf18240f7744.zip |
[CRYPTO] aes: Add wrappers for assembly routines
The wrapper routines are required when asmlinkage differs from the usual
calling convention. So we need to have them. However, by rearranging
the parameters, they will get optimised away to a single jump for most
people.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/x86_64/crypto')
-rw-r--r-- | arch/x86_64/crypto/aes-x86_64-asm.S | 8 | ||||
-rw-r--r-- | arch/x86_64/crypto/aes.c | 14 |
2 files changed, 16 insertions, 6 deletions
diff --git a/arch/x86_64/crypto/aes-x86_64-asm.S b/arch/x86_64/crypto/aes-x86_64-asm.S index f3ba643e144d..26b40de4d0b0 100644 --- a/arch/x86_64/crypto/aes-x86_64-asm.S +++ b/arch/x86_64/crypto/aes-x86_64-asm.S @@ -151,9 +151,9 @@ FUNC: movq r1,r2; \ #define decrypt_final(TAB,OFFSET) \ round(TAB,OFFSET,R2,R1,R4,R3,R6,R5,R7,R10,R5,R6,R3,R4) -/* void aes_encrypt(stuct crypto_tfm *tfm, u8 *out, const u8 *in) */ +/* void aes_enc_blk(stuct crypto_tfm *tfm, u8 *out, const u8 *in) */ - entry(aes_encrypt,0,enc128,enc192) + entry(aes_enc_blk,0,enc128,enc192) encrypt_round(aes_ft_tab,-96) encrypt_round(aes_ft_tab,-80) enc192: encrypt_round(aes_ft_tab,-64) @@ -170,9 +170,9 @@ enc128: encrypt_round(aes_ft_tab,-32) encrypt_final(aes_fl_tab,112) return -/* void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) */ +/* void aes_dec_blk(struct crypto_tfm *tfm, u8 *out, const u8 *in) */ - entry(aes_decrypt,240,dec128,dec192) + entry(aes_dec_blk,240,dec128,dec192) decrypt_round(aes_it_tab,-96) decrypt_round(aes_it_tab,-80) dec192: decrypt_round(aes_it_tab,-64) diff --git a/arch/x86_64/crypto/aes.c b/arch/x86_64/crypto/aes.c index d6f8e0463b5d..68866fab37aa 100644 --- a/arch/x86_64/crypto/aes.c +++ b/arch/x86_64/crypto/aes.c @@ -283,8 +283,18 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, return 0; } -extern void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in); -extern void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in); +asmlinkage void aes_enc_blk(struct crypto_tfm *tfm, u8 *out, const u8 *in); +asmlinkage void aes_dec_blk(struct crypto_tfm *tfm, u8 *out, const u8 *in); + +static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +{ + aes_enc_blk(tfm, dst, src); +} + +static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) +{ + aes_dec_blk(tfm, dst, src); +} static struct crypto_alg aes_alg = { .cra_name = "aes", |