diff options
Diffstat (limited to 'arch/x86/crypto/twofish-avx-x86_64-asm_64.S')
-rw-r--r-- | arch/x86/crypto/twofish-avx-x86_64-asm_64.S | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S index 8d3e113b2c95..05058134c443 100644 --- a/arch/x86/crypto/twofish-avx-x86_64-asm_64.S +++ b/arch/x86/crypto/twofish-avx-x86_64-asm_64.S | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (C) 2012 Johannes Goetzfried | 4 | * Copyright (C) 2012 Johannes Goetzfried |
5 | * <Johannes.Goetzfried@informatik.stud.uni-erlangen.de> | 5 | * <Johannes.Goetzfried@informatik.stud.uni-erlangen.de> |
6 | * | 6 | * |
7 | * Copyright © 2012 Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 7 | * Copyright © 2012-2013 Jussi Kivilinna <jussi.kivilinna@iki.fi> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -33,6 +33,8 @@ | |||
33 | 33 | ||
34 | .Lbswap128_mask: | 34 | .Lbswap128_mask: |
35 | .byte 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 | 35 | .byte 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 |
36 | .Lxts_gf128mul_and_shl1_mask: | ||
37 | .byte 0x87, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 | ||
36 | 38 | ||
37 | .text | 39 | .text |
38 | 40 | ||
@@ -408,3 +410,47 @@ ENTRY(twofish_ctr_8way) | |||
408 | 410 | ||
409 | ret; | 411 | ret; |
410 | ENDPROC(twofish_ctr_8way) | 412 | ENDPROC(twofish_ctr_8way) |
413 | |||
414 | ENTRY(twofish_xts_enc_8way) | ||
415 | /* input: | ||
416 | * %rdi: ctx, CTX | ||
417 | * %rsi: dst | ||
418 | * %rdx: src | ||
419 | * %rcx: iv (t ⊕ αⁿ ∈ GF(2¹²⁸)) | ||
420 | */ | ||
421 | |||
422 | movq %rsi, %r11; | ||
423 | |||
424 | /* regs <= src, dst <= IVs, regs <= regs xor IVs */ | ||
425 | load_xts_8way(%rcx, %rdx, %rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2, | ||
426 | RX0, RX1, RY0, .Lxts_gf128mul_and_shl1_mask); | ||
427 | |||
428 | call __twofish_enc_blk8; | ||
429 | |||
430 | /* dst <= regs xor IVs(in dst) */ | ||
431 | store_xts_8way(%r11, RC1, RD1, RA1, RB1, RC2, RD2, RA2, RB2); | ||
432 | |||
433 | ret; | ||
434 | ENDPROC(twofish_xts_enc_8way) | ||
435 | |||
436 | ENTRY(twofish_xts_dec_8way) | ||
437 | /* input: | ||
438 | * %rdi: ctx, CTX | ||
439 | * %rsi: dst | ||
440 | * %rdx: src | ||
441 | * %rcx: iv (t ⊕ αⁿ ∈ GF(2¹²⁸)) | ||
442 | */ | ||
443 | |||
444 | movq %rsi, %r11; | ||
445 | |||
446 | /* regs <= src, dst <= IVs, regs <= regs xor IVs */ | ||
447 | load_xts_8way(%rcx, %rdx, %rsi, RC1, RD1, RA1, RB1, RC2, RD2, RA2, RB2, | ||
448 | RX0, RX1, RY0, .Lxts_gf128mul_and_shl1_mask); | ||
449 | |||
450 | call __twofish_dec_blk8; | ||
451 | |||
452 | /* dst <= regs xor IVs(in dst) */ | ||
453 | store_xts_8way(%r11, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); | ||
454 | |||
455 | ret; | ||
456 | ENDPROC(twofish_xts_dec_8way) | ||