aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/chacha20
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-07 22:10:07 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-02-07 22:28:36 +0000
commit06a8ad2bae9e0aa0fe62e6059198bb3ec57eb08f (patch)
treea9d9d28c941840486c6697362dac219204672fda /src/libcryptobox/chacha20
parent1e2ff82baa69251c79576609c2a94bd0c006cd72 (diff)
downloadrspamd-06a8ad2bae9e0aa0fe62e6059198bb3ec57eb08f.tar.gz
rspamd-06a8ad2bae9e0aa0fe62e6059198bb3ec57eb08f.zip
Use optimized version of poly1305.
Diffstat (limited to 'src/libcryptobox/chacha20')
-rw-r--r--src/libcryptobox/chacha20/avx.S1
-rw-r--r--src/libcryptobox/chacha20/avx2.S1
-rw-r--r--src/libcryptobox/chacha20/chacha.c1
-rw-r--r--src/libcryptobox/chacha20/constants.S6
-rw-r--r--src/libcryptobox/chacha20/macro.S7
-rw-r--r--src/libcryptobox/chacha20/sse2.S2
6 files changed, 10 insertions, 8 deletions
diff --git a/src/libcryptobox/chacha20/avx.S b/src/libcryptobox/chacha20/avx.S
index 8e515d684..926613510 100644
--- a/src/libcryptobox/chacha20/avx.S
+++ b/src/libcryptobox/chacha20/avx.S
@@ -1,4 +1,5 @@
#include "macro.S"
+#include "constants.S"
SECTION_TEXT
GLOBAL_HIDDEN_FN chacha_blocks_avx
diff --git a/src/libcryptobox/chacha20/avx2.S b/src/libcryptobox/chacha20/avx2.S
index 7b1f9e1fc..71b333045 100644
--- a/src/libcryptobox/chacha20/avx2.S
+++ b/src/libcryptobox/chacha20/avx2.S
@@ -1,4 +1,5 @@
#include "macro.S"
+#include "constants.S"
SECTION_TEXT
GLOBAL_HIDDEN_FN chacha_blocks_avx2
diff --git a/src/libcryptobox/chacha20/chacha.c b/src/libcryptobox/chacha20/chacha.c
index a165bea63..b349d9ff9 100644
--- a/src/libcryptobox/chacha20/chacha.c
+++ b/src/libcryptobox/chacha20/chacha.c
@@ -1,4 +1,5 @@
/* Copyright (c) 2015, Vsevolod Stakhov
+ * Copyright (c) 2015, Andrew Moon
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/libcryptobox/chacha20/constants.S b/src/libcryptobox/chacha20/constants.S
new file mode 100644
index 000000000..ff109a38d
--- /dev/null
+++ b/src/libcryptobox/chacha20/constants.S
@@ -0,0 +1,6 @@
+SECTION_RODATA
+.p2align 4,,15
+chacha_constants:
+.long 0x61707865,0x3320646e,0x79622d32,0x6b206574 /* "expand 32-byte k" */
+.byte 2,3,0,1,6,7,4,5,10,11,8,9,14,15,12,13 /* pshufb rotate by 16 */
+.byte 3,0,1,2,7,4,5,6,11,8,9,10,15,12,13,14 /* pshufb rotate by 8 */
diff --git a/src/libcryptobox/chacha20/macro.S b/src/libcryptobox/chacha20/macro.S
index f4b4d0940..e498f8c19 100644
--- a/src/libcryptobox/chacha20/macro.S
+++ b/src/libcryptobox/chacha20/macro.S
@@ -176,10 +176,3 @@
#endif
#endif
.endm
-
-SECTION_RODATA
-.p2align 4,,15
-chacha_constants:
-.long 0x61707865,0x3320646e,0x79622d32,0x6b206574 /* "expand 32-byte k" */
-.byte 2,3,0,1,6,7,4,5,10,11,8,9,14,15,12,13 /* pshufb rotate by 16 */
-.byte 3,0,1,2,7,4,5,6,11,8,9,10,15,12,13,14 /* pshufb rotate by 8 */
diff --git a/src/libcryptobox/chacha20/sse2.S b/src/libcryptobox/chacha20/sse2.S
index 91bfa2a44..a896b93be 100644
--- a/src/libcryptobox/chacha20/sse2.S
+++ b/src/libcryptobox/chacha20/sse2.S
@@ -1,5 +1,5 @@
#include "macro.S"
-
+#include "constants.S"
SECTION_TEXT
GLOBAL_HIDDEN_FN chacha_blocks_sse2