summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/crypto/blake2s-avx-x86_64.S13
-rw-r--r--src/crypto/chacha20-avx2-x86_64.S7
-rw-r--r--src/crypto/chacha20-ssse3-x86_64.S11
-rw-r--r--src/crypto/poly1305-avx2-x86_64.S5
-rw-r--r--src/crypto/poly1305-sse2-x86_64.S5
5 files changed, 27 insertions, 14 deletions
diff --git a/src/crypto/blake2s-avx-x86_64.S b/src/crypto/blake2s-avx-x86_64.S
index 664bd89..f7f4b3f 100644
--- a/src/crypto/blake2s-avx-x86_64.S
+++ b/src/crypto/blake2s-avx-x86_64.S
@@ -5,13 +5,16 @@
#include <linux/linkage.h>
-.data
+.section .rodata.cst32.BLAKECONST, "aM", @progbits, 32
.align 32
IV: .octa 0xA54FF53A3C6EF372BB67AE856A09E667
.octa 0x5BE0CD191F83D9AB9B05688C510E527F
+.section .rodata.cst16.ROT16, "aM", @progbits, 16
.align 16
-ARG1: .octa 0x0D0C0F0E09080B0A0504070601000302
-ARG2: .octa 0x0C0F0E0D080B0A090407060500030201
+ROT16: .octa 0x0D0C0F0E09080B0A0504070601000302
+.section .rodata.cst16.ROR328, "aM", @progbits, 16
+.align 16
+ROR328: .octa 0x0C0F0E0D080B0A090407060500030201
.text
ENTRY(blake2s_compress_avx)
@@ -20,7 +23,7 @@ ENTRY(blake2s_compress_avx)
vpxor 32(%rdi), %xmm1, %xmm1
vmovdqu 16(%rsi), %xmm3
vshufps $136, %xmm3, %xmm4, %xmm6
- vmovdqa ARG1(%rip), %xmm7
+ vmovdqa ROT16(%rip), %xmm7
vpaddd (%rdi), %xmm6, %xmm6
vpaddd 16(%rdi), %xmm6, %xmm6
vpxor %xmm6, %xmm1, %xmm1
@@ -40,7 +43,7 @@ ENTRY(blake2s_compress_avx)
vpaddd %xmm9, %xmm6, %xmm9
vpaddd %xmm0, %xmm9, %xmm9
vpxor %xmm9, %xmm1, %xmm1
- vmovdqa ARG2(%rip), %xmm6
+ vmovdqa ROR328(%rip), %xmm6
vpshufb %xmm6, %xmm1, %xmm1
vpaddd %xmm1, %xmm8, %xmm8
vpxor %xmm8, %xmm0, %xmm0
diff --git a/src/crypto/chacha20-avx2-x86_64.S b/src/crypto/chacha20-avx2-x86_64.S
index 2bbbc98..8aabae0 100644
--- a/src/crypto/chacha20-avx2-x86_64.S
+++ b/src/crypto/chacha20-avx2-x86_64.S
@@ -11,13 +11,16 @@
#include <linux/linkage.h>
-.data
+.section .rodata.cst32.ROT8, "aM", @progbits, 32
.align 32
-
ROT8: .octa 0x0e0d0c0f0a09080b0605040702010003
.octa 0x0e0d0c0f0a09080b0605040702010003
+.section .rodata.cst32.ROT16, "aM", @progbits, 32
+.align 32
ROT16: .octa 0x0d0c0f0e09080b0a0504070601000302
.octa 0x0d0c0f0e09080b0a0504070601000302
+.section .rodata.cst32.CTRINC, "aM", @progbits, 32
+.align 32
CTRINC: .octa 0x00000003000000020000000100000000
.octa 0x00000007000000060000000500000004
diff --git a/src/crypto/chacha20-ssse3-x86_64.S b/src/crypto/chacha20-ssse3-x86_64.S
index be4b9b7..f1fe3c9 100644
--- a/src/crypto/chacha20-ssse3-x86_64.S
+++ b/src/crypto/chacha20-ssse3-x86_64.S
@@ -12,12 +12,17 @@
#include <linux/linkage.h>
-.data
+.section .rodata.cst16.ROT8, "aM", @progbits, 16
+.align 16
+ROT8:.octa 0x0e0d0c0f0a09080b0605040702010003
+.section .rodata.cst16.ROT16, "aM", @progbits, 16
.align 16
-
-ROT8: .octa 0x0e0d0c0f0a09080b0605040702010003
ROT16: .octa 0x0d0c0f0e09080b0a0504070601000302
+.section .rodata.cst16.CTRINC, "aM", @progbits, 16
+.align 16
CTRINC: .octa 0x00000003000000020000000100000000
+.section .rodata.cst16.CHACONST, "aM", @progbits, 16
+.align 16
CONST: .ascii "expand 32-byte k"
.text
diff --git a/src/crypto/poly1305-avx2-x86_64.S b/src/crypto/poly1305-avx2-x86_64.S
index f5b8c8a..35d958f 100644
--- a/src/crypto/poly1305-avx2-x86_64.S
+++ b/src/crypto/poly1305-avx2-x86_64.S
@@ -11,11 +11,12 @@
#include <linux/linkage.h>
-.data
+.section .rodata.cst32.ANMASK, "aM", @progbits, 32
.align 32
-
ANMASK: .octa 0x0000000003ffffff0000000003ffffff
.octa 0x0000000003ffffff0000000003ffffff
+.section .rodata.cst32.ORMASK, "aM", @progbits, 32
+.align 32
ORMASK: .octa 0x00000000010000000000000001000000
.octa 0x00000000010000000000000001000000
diff --git a/src/crypto/poly1305-sse2-x86_64.S b/src/crypto/poly1305-sse2-x86_64.S
index 97fa41f..2a3a4e6 100644
--- a/src/crypto/poly1305-sse2-x86_64.S
+++ b/src/crypto/poly1305-sse2-x86_64.S
@@ -11,10 +11,11 @@
#include <linux/linkage.h>
-.data
+.section .rodata.cst16.ANMASK, "aM", @progbits, 16
.align 16
-
ANMASK: .octa 0x0000000003ffffff0000000003ffffff
+.section .rodata.cst16.ORMASK, "aM", @progbits, 16
+.align 16
ORMASK: .octa 0x00000000010000000000000001000000
.text