diff options
-rw-r--r-- | arch/x86/crypto/twofish-i586-asm_32.S | 10 | ||||
-rw-r--r-- | arch/x86/crypto/twofish-x86_64-asm_64.S | 6 | ||||
-rw-r--r-- | arch/x86/crypto/twofish_glue.c | 12 |
3 files changed, 15 insertions, 13 deletions
diff --git a/arch/x86/crypto/twofish-i586-asm_32.S b/arch/x86/crypto/twofish-i586-asm_32.S index 575331cb2a8a..658af4bb35c9 100644 --- a/arch/x86/crypto/twofish-i586-asm_32.S +++ b/arch/x86/crypto/twofish-i586-asm_32.S | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #define in_blk 12 /* input byte array address parameter*/ | 27 | #define in_blk 12 /* input byte array address parameter*/ |
28 | #define out_blk 8 /* output byte array address parameter*/ | 28 | #define out_blk 8 /* output byte array address parameter*/ |
29 | #define tfm 4 /* Twofish context structure */ | 29 | #define ctx 4 /* Twofish context structure */ |
30 | 30 | ||
31 | #define a_offset 0 | 31 | #define a_offset 0 |
32 | #define b_offset 4 | 32 | #define b_offset 4 |
@@ -229,8 +229,8 @@ twofish_enc_blk: | |||
229 | push %esi | 229 | push %esi |
230 | push %edi | 230 | push %edi |
231 | 231 | ||
232 | mov tfm + 16(%esp), %ebp /* abuse the base pointer: set new base bointer to the crypto tfm */ | 232 | mov ctx + 16(%esp), %ebp /* abuse the base pointer: set new base |
233 | add $crypto_tfm_ctx_offset, %ebp /* ctx address */ | 233 | * pointer to the ctx address */ |
234 | mov in_blk+16(%esp),%edi /* input address in edi */ | 234 | mov in_blk+16(%esp),%edi /* input address in edi */ |
235 | 235 | ||
236 | mov (%edi), %eax | 236 | mov (%edi), %eax |
@@ -285,8 +285,8 @@ twofish_dec_blk: | |||
285 | push %edi | 285 | push %edi |
286 | 286 | ||
287 | 287 | ||
288 | mov tfm + 16(%esp), %ebp /* abuse the base pointer: set new base bointer to the crypto tfm */ | 288 | mov ctx + 16(%esp), %ebp /* abuse the base pointer: set new base |
289 | add $crypto_tfm_ctx_offset, %ebp /* ctx address */ | 289 | * pointer to the ctx address */ |
290 | mov in_blk+16(%esp),%edi /* input address in edi */ | 290 | mov in_blk+16(%esp),%edi /* input address in edi */ |
291 | 291 | ||
292 | mov (%edi), %eax | 292 | mov (%edi), %eax |
diff --git a/arch/x86/crypto/twofish-x86_64-asm_64.S b/arch/x86/crypto/twofish-x86_64-asm_64.S index 573aa102542e..7bcf3fcc3668 100644 --- a/arch/x86/crypto/twofish-x86_64-asm_64.S +++ b/arch/x86/crypto/twofish-x86_64-asm_64.S | |||
@@ -221,10 +221,9 @@ | |||
221 | twofish_enc_blk: | 221 | twofish_enc_blk: |
222 | pushq R1 | 222 | pushq R1 |
223 | 223 | ||
224 | /* %rdi contains the crypto tfm address */ | 224 | /* %rdi contains the ctx address */ |
225 | /* %rsi contains the output address */ | 225 | /* %rsi contains the output address */ |
226 | /* %rdx contains the input address */ | 226 | /* %rdx contains the input address */ |
227 | add $crypto_tfm_ctx_offset, %rdi /* set ctx address */ | ||
228 | /* ctx address is moved to free one non-rex register | 227 | /* ctx address is moved to free one non-rex register |
229 | as target for the 8bit high operations */ | 228 | as target for the 8bit high operations */ |
230 | mov %rdi, %r11 | 229 | mov %rdi, %r11 |
@@ -274,10 +273,9 @@ twofish_enc_blk: | |||
274 | twofish_dec_blk: | 273 | twofish_dec_blk: |
275 | pushq R1 | 274 | pushq R1 |
276 | 275 | ||
277 | /* %rdi contains the crypto tfm address */ | 276 | /* %rdi contains the ctx address */ |
278 | /* %rsi contains the output address */ | 277 | /* %rsi contains the output address */ |
279 | /* %rdx contains the input address */ | 278 | /* %rdx contains the input address */ |
280 | add $crypto_tfm_ctx_offset, %rdi /* set ctx address */ | ||
281 | /* ctx address is moved to free one non-rex register | 279 | /* ctx address is moved to free one non-rex register |
282 | as target for the 8bit high operations */ | 280 | as target for the 8bit high operations */ |
283 | mov %rdi, %r11 | 281 | mov %rdi, %r11 |
diff --git a/arch/x86/crypto/twofish_glue.c b/arch/x86/crypto/twofish_glue.c index cefaf8b9aa18..dc6b3fb817fc 100644 --- a/arch/x86/crypto/twofish_glue.c +++ b/arch/x86/crypto/twofish_glue.c | |||
@@ -44,17 +44,21 @@ | |||
44 | #include <linux/module.h> | 44 | #include <linux/module.h> |
45 | #include <linux/types.h> | 45 | #include <linux/types.h> |
46 | 46 | ||
47 | asmlinkage void twofish_enc_blk(struct crypto_tfm *tfm, u8 *dst, const u8 *src); | 47 | asmlinkage void twofish_enc_blk(struct twofish_ctx *ctx, u8 *dst, |
48 | asmlinkage void twofish_dec_blk(struct crypto_tfm *tfm, u8 *dst, const u8 *src); | 48 | const u8 *src); |
49 | EXPORT_SYMBOL_GPL(twofish_enc_blk); | ||
50 | asmlinkage void twofish_dec_blk(struct twofish_ctx *ctx, u8 *dst, | ||
51 | const u8 *src); | ||
52 | EXPORT_SYMBOL_GPL(twofish_dec_blk); | ||
49 | 53 | ||
50 | static void twofish_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) | 54 | static void twofish_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) |
51 | { | 55 | { |
52 | twofish_enc_blk(tfm, dst, src); | 56 | twofish_enc_blk(crypto_tfm_ctx(tfm), dst, src); |
53 | } | 57 | } |
54 | 58 | ||
55 | static void twofish_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) | 59 | static void twofish_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) |
56 | { | 60 | { |
57 | twofish_dec_blk(tfm, dst, src); | 61 | twofish_dec_blk(crypto_tfm_ctx(tfm), dst, src); |
58 | } | 62 | } |
59 | 63 | ||
60 | static struct crypto_alg alg = { | 64 | static struct crypto_alg alg = { |