From 620f0480113fec1bfd024928722ebd7bd4d74be2 Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Mon, 26 Sep 2011 16:47:20 +0300 Subject: [PATCH] --- yaml --- r: 272287 b: refs/heads/master c: 91d41f159d75d602f6001218eec64c5e761475a6 h: refs/heads/master i: 272285: 4515807407905a03aae3a5f7fa2b6df3916e1774 272283: a71687695083ad6259c70059be4fae716e42ce28 272279: 277d85cc0e28f5f530198eeb32e6b51653695a22 272271: 16e6da5b43fd462e52da96405662f02345f16359 272255: 3d87adae544a81e89b1a1b67f307caf5d302d7e0 v: v3 --- [refs] | 2 +- trunk/arch/x86/crypto/twofish-i586-asm_32.S | 10 +++++----- trunk/arch/x86/crypto/twofish-x86_64-asm_64.S | 6 ++---- trunk/arch/x86/crypto/twofish_glue.c | 12 ++++++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index eb3b8a88db08..c85562314190 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ee5002a5497f3219b4144b5370203ed6e43f7269 +refs/heads/master: 91d41f159d75d602f6001218eec64c5e761475a6 diff --git a/trunk/arch/x86/crypto/twofish-i586-asm_32.S b/trunk/arch/x86/crypto/twofish-i586-asm_32.S index 575331cb2a8a..658af4bb35c9 100644 --- a/trunk/arch/x86/crypto/twofish-i586-asm_32.S +++ b/trunk/arch/x86/crypto/twofish-i586-asm_32.S @@ -26,7 +26,7 @@ #define in_blk 12 /* input byte array address parameter*/ #define out_blk 8 /* output byte array address parameter*/ -#define tfm 4 /* Twofish context structure */ +#define ctx 4 /* Twofish context structure */ #define a_offset 0 #define b_offset 4 @@ -229,8 +229,8 @@ twofish_enc_blk: push %esi push %edi - mov tfm + 16(%esp), %ebp /* abuse the base pointer: set new base bointer to the crypto tfm */ - add $crypto_tfm_ctx_offset, %ebp /* ctx address */ + mov ctx + 16(%esp), %ebp /* abuse the base pointer: set new base + * pointer to the ctx address */ mov in_blk+16(%esp),%edi /* input address in edi */ mov (%edi), %eax @@ -285,8 +285,8 @@ twofish_dec_blk: push %edi - mov tfm + 16(%esp), %ebp /* abuse the base pointer: set new base bointer to the crypto tfm */ - add $crypto_tfm_ctx_offset, %ebp /* ctx address */ + mov ctx + 16(%esp), %ebp /* abuse the base pointer: set new base + * pointer to the ctx address */ mov in_blk+16(%esp),%edi /* input address in edi */ mov (%edi), %eax diff --git a/trunk/arch/x86/crypto/twofish-x86_64-asm_64.S b/trunk/arch/x86/crypto/twofish-x86_64-asm_64.S index 573aa102542e..7bcf3fcc3668 100644 --- a/trunk/arch/x86/crypto/twofish-x86_64-asm_64.S +++ b/trunk/arch/x86/crypto/twofish-x86_64-asm_64.S @@ -221,10 +221,9 @@ twofish_enc_blk: pushq R1 - /* %rdi contains the crypto tfm address */ + /* %rdi contains the ctx address */ /* %rsi contains the output address */ /* %rdx contains the input address */ - add $crypto_tfm_ctx_offset, %rdi /* set ctx address */ /* ctx address is moved to free one non-rex register as target for the 8bit high operations */ mov %rdi, %r11 @@ -274,10 +273,9 @@ twofish_enc_blk: twofish_dec_blk: pushq R1 - /* %rdi contains the crypto tfm address */ + /* %rdi contains the ctx address */ /* %rsi contains the output address */ /* %rdx contains the input address */ - add $crypto_tfm_ctx_offset, %rdi /* set ctx address */ /* ctx address is moved to free one non-rex register as target for the 8bit high operations */ mov %rdi, %r11 diff --git a/trunk/arch/x86/crypto/twofish_glue.c b/trunk/arch/x86/crypto/twofish_glue.c index cefaf8b9aa18..dc6b3fb817fc 100644 --- a/trunk/arch/x86/crypto/twofish_glue.c +++ b/trunk/arch/x86/crypto/twofish_glue.c @@ -44,17 +44,21 @@ #include #include -asmlinkage void twofish_enc_blk(struct crypto_tfm *tfm, u8 *dst, const u8 *src); -asmlinkage void twofish_dec_blk(struct crypto_tfm *tfm, u8 *dst, const u8 *src); +asmlinkage void twofish_enc_blk(struct twofish_ctx *ctx, u8 *dst, + const u8 *src); +EXPORT_SYMBOL_GPL(twofish_enc_blk); +asmlinkage void twofish_dec_blk(struct twofish_ctx *ctx, u8 *dst, + const u8 *src); +EXPORT_SYMBOL_GPL(twofish_dec_blk); static void twofish_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { - twofish_enc_blk(tfm, dst, src); + twofish_enc_blk(crypto_tfm_ctx(tfm), dst, src); } static void twofish_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { - twofish_dec_blk(tfm, dst, src); + twofish_dec_blk(crypto_tfm_ctx(tfm), dst, src); } static struct crypto_alg alg = {