Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cr-marcstevens/sha1collisiondetection.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Shumow <shumow@gmail.com>2017-05-09 17:23:44 +0300
committerDan Shumow <shumow@gmail.com>2017-05-09 17:23:44 +0300
commit26446e8c6eb2a5bd9ce9a16523337619f21ce42d (patch)
treef5155b9f205d8a71ba30e99452020ae22ac074d4
parentb94757944f597f7e44541a0f4217178618eaeaaf (diff)
Establishes data structure prototypes for SIMD aligned data.
-rw-r--r--lib/simd/sha1_simd.c179
-rw-r--r--lib/simd/sha1_simd.cinc32
-rw-r--r--lib/simd/sha1_simd_avx256.c14
-rw-r--r--lib/simd/sha1_simd_avx512.c15
-rw-r--r--lib/simd/sha1_simd_mmx64.c14
-rw-r--r--lib/simd/sha1_simd_neon128.c14
-rw-r--r--lib/simd/sha1_simd_sse128.c14
7 files changed, 168 insertions, 114 deletions
diff --git a/lib/simd/sha1_simd.c b/lib/simd/sha1_simd.c
index 0fb9409..1a07c40 100644
--- a/lib/simd/sha1_simd.c
+++ b/lib/simd/sha1_simd.c
@@ -5,95 +5,106 @@
* https://opensource.org/licenses/MIT
***/
+#include <stdlib.h>
#include <stdint.h>
-#define CNT_SHA1_DVS (14)
-uint32_t sha1_dvs_simd[80][CNT_SHA1_DVS] =
+#include <sha1.h>
+
+#define CNT_SHA1_DVS (16)
+uint32_t sha1_dvs_interleaved[80][CNT_SHA1_DVS] =
{
- { 0x2c000010, 0xb800000a, 0x18000000, 0x0800000c, 0xe8000000, 0xe000002a, 0x60000000, 0x2400001c, 0xb400001c, 0xc0000010, 0x0c000002, 0xcc000014, 0x0400001c, 0x2600001a},
- { 0xf4000014, 0xc8000010, 0xb800000a, 0x18000000, 0x0800000c, 0x20000043, 0xe000002a, 0xec000014, 0x3c000004, 0xb400001c, 0xc0000010, 0x0c000002, 0xcc000014, 0x00000010},
- { 0xb4000008, 0x2c000010, 0xc8000010, 0xb800000a, 0x18000000, 0xb0000040, 0x20000043, 0x0c000002, 0xbc00001a, 0x3c000004, 0xb400001c, 0xc0000010, 0x0c000002, 0x0400001c},
- { 0x08000000, 0xf4000014, 0x2c000010, 0xc8000010, 0xb800000a, 0xd0000053, 0xb0000040, 0xc0000010, 0x20000010, 0xbc00001a, 0x3c000004, 0xb400001c, 0xc0000010, 0xcc000014},
- { 0x9800000c, 0xb4000008, 0xf4000014, 0x2c000010, 0xc8000010, 0xd0000022, 0xd0000053, 0xb400001c, 0x2400001c, 0x20000010, 0xbc00001a, 0x3c000004, 0xb400001c, 0x0c000002},
- { 0xd8000010, 0x08000000, 0xb4000008, 0xf4000014, 0x2c000010, 0x20000000, 0xd0000022, 0x2c000004, 0xec000014, 0x2400001c, 0x20000010, 0xbc00001a, 0x3c000004, 0xc0000010},
- { 0x08000010, 0x9800000c, 0x08000000, 0xb4000008, 0xf4000014, 0x60000032, 0x20000000, 0xbc000018, 0x0c000002, 0xec000014, 0x2400001c, 0x20000010, 0xbc00001a, 0xb400001c},
- { 0xb8000010, 0xd8000010, 0x9800000c, 0x08000000, 0xb4000008, 0x60000043, 0x60000032, 0xb0000010, 0xc0000010, 0x0c000002, 0xec000014, 0x2400001c, 0x20000010, 0x3c000004},
- { 0x98000000, 0x08000010, 0xd8000010, 0x9800000c, 0x08000000, 0x20000040, 0x60000043, 0x0000000c, 0xb400001c, 0xc0000010, 0x0c000002, 0xec000014, 0x2400001c, 0xbc00001a},
- { 0x60000000, 0xb8000010, 0x08000010, 0xd8000010, 0x9800000c, 0xe0000042, 0x20000040, 0xb8000010, 0x2c000004, 0xb400001c, 0xc0000010, 0x0c000002, 0xec000014, 0x20000010},
- { 0x00000008, 0x98000000, 0xb8000010, 0x08000010, 0xd8000010, 0x60000002, 0xe0000042, 0x08000018, 0xbc000018, 0x2c000004, 0xb400001c, 0xc0000010, 0x0c000002, 0x2400001c},
- { 0xc0000000, 0x60000000, 0x98000000, 0xb8000010, 0x08000010, 0x80000001, 0x60000002, 0x78000010, 0xb0000010, 0xbc000018, 0x2c000004, 0xb400001c, 0xc0000010, 0xec000014},
- { 0x90000014, 0x00000008, 0x60000000, 0x98000000, 0xb8000010, 0x00000020, 0x80000001, 0x08000014, 0x0000000c, 0xb0000010, 0xbc000018, 0x2c000004, 0xb400001c, 0x0c000002},
- { 0x10000010, 0xc0000000, 0x00000008, 0x60000000, 0x98000000, 0x00000003, 0x00000020, 0x70000010, 0xb8000010, 0x0000000c, 0xb0000010, 0xbc000018, 0x2c000004, 0xc0000010},
- { 0xb8000014, 0x90000014, 0xc0000000, 0x00000008, 0x60000000, 0x40000052, 0x00000003, 0xb800001c, 0x08000018, 0xb8000010, 0x0000000c, 0xb0000010, 0xbc000018, 0xb400001c},
- { 0x28000000, 0x10000010, 0x90000014, 0xc0000000, 0x00000008, 0x40000040, 0x40000052, 0xe8000000, 0x78000010, 0x08000018, 0xb8000010, 0x0000000c, 0xb0000010, 0x2c000004},
- { 0x20000010, 0xb8000014, 0x10000010, 0x90000014, 0xc0000000, 0xe0000052, 0x40000040, 0xb0000004, 0x08000014, 0x78000010, 0x08000018, 0xb8000010, 0x0000000c, 0xbc000018},
- { 0x48000000, 0x28000000, 0xb8000014, 0x10000010, 0x90000014, 0xa0000000, 0xe0000052, 0x58000010, 0x70000010, 0x08000014, 0x78000010, 0x08000018, 0xb8000010, 0xb0000010},
- { 0x08000018, 0x20000010, 0x28000000, 0xb8000014, 0x10000010, 0x80000040, 0xa0000000, 0xb000000c, 0xb800001c, 0x70000010, 0x08000014, 0x78000010, 0x08000018, 0x0000000c},
- { 0x60000000, 0x48000000, 0x20000010, 0x28000000, 0xb8000014, 0x20000001, 0x80000040, 0x48000000, 0xe8000000, 0xb800001c, 0x70000010, 0x08000014, 0x78000010, 0xb8000010},
- { 0x90000010, 0x08000018, 0x48000000, 0x20000010, 0x28000000, 0x20000060, 0x20000001, 0xb0000000, 0xb0000004, 0xe8000000, 0xb800001c, 0x70000010, 0x08000014, 0x08000018},
- { 0xf0000010, 0x60000000, 0x08000018, 0x48000000, 0x20000010, 0x80000001, 0x20000060, 0xb8000010, 0x58000010, 0xb0000004, 0xe8000000, 0xb800001c, 0x70000010, 0x78000010},
- { 0x90000008, 0x90000010, 0x60000000, 0x08000018, 0x48000000, 0x40000042, 0x80000001, 0x98000010, 0xb000000c, 0x58000010, 0xb0000004, 0xe8000000, 0xb800001c, 0x08000014},
- { 0xc0000000, 0xf0000010, 0x90000010, 0x60000000, 0x08000018, 0xc0000043, 0x40000042, 0xa0000000, 0x48000000, 0xb000000c, 0x58000010, 0xb0000004, 0xe8000000, 0x70000010},
- { 0x90000010, 0x90000008, 0xf0000010, 0x90000010, 0x60000000, 0x40000022, 0xc0000043, 0x00000000, 0xb0000000, 0x48000000, 0xb000000c, 0x58000010, 0xb0000004, 0xb800001c},
- { 0xf0000010, 0xc0000000, 0x90000008, 0xf0000010, 0x90000010, 0x00000003, 0x40000022, 0x00000000, 0xb8000010, 0xb0000000, 0x48000000, 0xb000000c, 0x58000010, 0xe8000000},
- { 0xb0000008, 0x90000010, 0xc0000000, 0x90000008, 0xf0000010, 0x40000042, 0x00000003, 0x20000000, 0x98000010, 0xb8000010, 0xb0000000, 0x48000000, 0xb000000c, 0xb0000004},
- { 0x40000000, 0xf0000010, 0x90000010, 0xc0000000, 0x90000008, 0xc0000043, 0x40000042, 0x80000000, 0xa0000000, 0x98000010, 0xb8000010, 0xb0000000, 0x48000000, 0x58000010},
- { 0x90000000, 0xb0000008, 0xf0000010, 0x90000010, 0xc0000000, 0xc0000022, 0xc0000043, 0x00000010, 0x00000000, 0xa0000000, 0x98000010, 0xb8000010, 0xb0000000, 0xb000000c},
- { 0xf0000010, 0x40000000, 0xb0000008, 0xf0000010, 0x90000010, 0x00000001, 0xc0000022, 0x00000000, 0x00000000, 0x00000000, 0xa0000000, 0x98000010, 0xb8000010, 0x48000000},
- { 0x90000018, 0x90000000, 0x40000000, 0xb0000008, 0xf0000010, 0x40000002, 0x00000001, 0x20000010, 0x20000000, 0x00000000, 0x00000000, 0xa0000000, 0x98000010, 0xb0000000},
- { 0x60000000, 0xf0000010, 0x90000000, 0x40000000, 0xb0000008, 0xc0000043, 0x40000002, 0x20000000, 0x80000000, 0x20000000, 0x00000000, 0x00000000, 0xa0000000, 0xb8000010},
- { 0x90000010, 0x90000018, 0xf0000010, 0x90000000, 0x40000000, 0x40000062, 0xc0000043, 0x00000010, 0x00000010, 0x80000000, 0x20000000, 0x00000000, 0x00000000, 0x98000010},
- { 0x90000010, 0x60000000, 0x90000018, 0xf0000010, 0x90000000, 0x80000001, 0x40000062, 0x60000000, 0x00000000, 0x00000010, 0x80000000, 0x20000000, 0x00000000, 0xa0000000},
- { 0x90000000, 0x90000010, 0x60000000, 0x90000018, 0xf0000010, 0x40000042, 0x80000001, 0x00000018, 0x20000010, 0x00000000, 0x00000010, 0x80000000, 0x20000000, 0x00000000},
- { 0x80000000, 0x90000010, 0x90000010, 0x60000000, 0x90000018, 0x40000042, 0x40000042, 0xe0000000, 0x20000000, 0x20000010, 0x00000000, 0x00000010, 0x80000000, 0x00000000},
- { 0x00000010, 0x90000000, 0x90000010, 0x90000010, 0x60000000, 0x40000002, 0x40000042, 0x90000000, 0x00000010, 0x20000000, 0x20000010, 0x00000000, 0x00000010, 0x20000000},
- { 0xa0000000, 0x80000000, 0x90000000, 0x90000010, 0x90000010, 0x00000002, 0x40000002, 0x30000010, 0x60000000, 0x00000010, 0x20000000, 0x20000010, 0x00000000, 0x80000000},
- { 0x20000000, 0x00000010, 0x80000000, 0x90000000, 0x90000010, 0x00000040, 0x00000002, 0xb0000000, 0x00000018, 0x60000000, 0x00000010, 0x20000000, 0x20000010, 0x00000010},
- { 0xa0000000, 0xa0000000, 0x00000010, 0x80000000, 0x90000000, 0x80000002, 0x00000040, 0x20000000, 0xe0000000, 0x00000018, 0x60000000, 0x00000010, 0x20000000, 0x00000000},
- { 0x20000010, 0x20000000, 0xa0000000, 0x00000010, 0x80000000, 0x80000000, 0x80000002, 0x20000000, 0x90000000, 0xe0000000, 0x00000018, 0x60000000, 0x00000010, 0x20000010},
- { 0x00000000, 0xa0000000, 0x20000000, 0xa0000000, 0x00000010, 0x80000002, 0x80000000, 0xa0000000, 0x30000010, 0x90000000, 0xe0000000, 0x00000018, 0x60000000, 0x20000000},
- { 0x20000010, 0x20000010, 0xa0000000, 0x20000000, 0xa0000000, 0x80000040, 0x80000002, 0x00000010, 0xb0000000, 0x30000010, 0x90000000, 0xe0000000, 0x00000018, 0x00000010},
- { 0x20000000, 0x00000000, 0x20000010, 0xa0000000, 0x20000000, 0x00000000, 0x80000040, 0x80000000, 0x20000000, 0xb0000000, 0x30000010, 0x90000000, 0xe0000000, 0x60000000},
- { 0x00000010, 0x20000010, 0x00000000, 0x20000010, 0xa0000000, 0x80000040, 0x00000000, 0x20000000, 0x20000000, 0x20000000, 0xb0000000, 0x30000010, 0x90000000, 0x00000018},
- { 0x20000000, 0x20000000, 0x20000010, 0x00000000, 0x20000010, 0x80000000, 0x80000040, 0x20000000, 0xa0000000, 0x20000000, 0x20000000, 0xb0000000, 0x30000010, 0xe0000000},
- { 0x00000010, 0x00000010, 0x20000000, 0x20000010, 0x00000000, 0x00000040, 0x80000000, 0x20000000, 0x00000010, 0xa0000000, 0x20000000, 0x20000000, 0xb0000000, 0x90000000},
- { 0xa0000000, 0x20000000, 0x00000010, 0x20000000, 0x20000010, 0x80000000, 0x00000040, 0x80000000, 0x80000000, 0x00000010, 0xa0000000, 0x20000000, 0x20000000, 0x30000010},
- { 0x00000000, 0x00000010, 0x20000000, 0x00000010, 0x20000000, 0x00000040, 0x80000000, 0x00000010, 0x20000000, 0x80000000, 0x00000010, 0xa0000000, 0x20000000, 0xb0000000},
- { 0x20000000, 0xa0000000, 0x00000010, 0x20000000, 0x00000010, 0x80000002, 0x00000040, 0x00000000, 0x20000000, 0x20000000, 0x80000000, 0x00000010, 0xa0000000, 0x20000000},
- { 0x20000000, 0x00000000, 0xa0000000, 0x00000010, 0x20000000, 0x00000000, 0x80000002, 0x20000010, 0x20000000, 0x20000000, 0x20000000, 0x80000000, 0x00000010, 0x20000000},
- { 0x00000000, 0x20000000, 0x00000000, 0xa0000000, 0x00000010, 0x80000000, 0x00000000, 0xa0000000, 0x80000000, 0x20000000, 0x20000000, 0x20000000, 0x80000000, 0xa0000000},
- { 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0xa0000000, 0x80000000, 0x80000000, 0x00000000, 0x00000010, 0x80000000, 0x20000000, 0x20000000, 0x20000000, 0x00000010},
- { 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x80000000, 0x20000000, 0x00000000, 0x00000010, 0x80000000, 0x20000000, 0x20000000, 0x80000000},
- { 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x20000000, 0x20000010, 0x00000000, 0x00000010, 0x80000000, 0x20000000, 0x20000000},
- { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0xa0000000, 0x20000010, 0x00000000, 0x00000010, 0x80000000, 0x20000000},
- { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xa0000000, 0x20000010, 0x00000000, 0x00000010, 0x20000000},
- { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x00000000, 0xa0000000, 0x20000010, 0x00000000, 0x80000000},
- { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0xa0000000, 0x20000010, 0x00000010},
- { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0xa0000000, 0x00000000},
- { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x20000010},
- { 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0xa0000000},
- { 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x00000000},
- { 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000},
- { 0x40000002, 0x00000020, 0x00000001, 0x00000000, 0x00000000, 0x00000080, 0x00000004, 0x40000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000},
- { 0x40000040, 0x00000001, 0x00000020, 0x00000001, 0x00000000, 0x00000004, 0x00000080, 0x40000041, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
- { 0x40000002, 0x40000002, 0x00000001, 0x00000020, 0x00000001, 0x00000009, 0x00000004, 0x40000022, 0x00000020, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
- { 0x80000004, 0x40000040, 0x40000002, 0x00000001, 0x00000020, 0x00000101, 0x00000009, 0x80000005, 0x00000001, 0x00000020, 0x00000001, 0x00000000, 0x00000000, 0x00000000},
- { 0x80000080, 0x40000002, 0x40000040, 0x40000002, 0x00000001, 0x00000009, 0x00000101, 0xc0000082, 0x40000002, 0x00000001, 0x00000020, 0x00000001, 0x00000000, 0x00000000},
- { 0x80000006, 0x80000004, 0x40000002, 0x40000040, 0x40000002, 0x00000012, 0x00000009, 0xc0000046, 0x40000041, 0x40000002, 0x00000001, 0x00000020, 0x00000001, 0x00000000},
- { 0x00000049, 0x80000080, 0x80000004, 0x40000002, 0x40000040, 0x00000202, 0x00000012, 0x4000004b, 0x40000022, 0x40000041, 0x40000002, 0x00000001, 0x00000020, 0x00000000},
- { 0x00000103, 0x80000006, 0x80000080, 0x80000004, 0x40000002, 0x0000001a, 0x00000202, 0x80000107, 0x80000005, 0x40000022, 0x40000041, 0x40000002, 0x00000001, 0x00000001},
- { 0x80000009, 0x00000049, 0x80000006, 0x80000080, 0x80000004, 0x00000124, 0x0000001a, 0x00000089, 0xc0000082, 0x80000005, 0x40000022, 0x40000041, 0x40000002, 0x00000020},
- { 0x80000012, 0x00000103, 0x00000049, 0x80000006, 0x80000080, 0x0000040c, 0x00000124, 0x00000014, 0xc0000046, 0xc0000082, 0x80000005, 0x40000022, 0x40000041, 0x00000001},
- { 0x80000202, 0x80000009, 0x00000103, 0x00000049, 0x80000006, 0x00000026, 0x0000040c, 0x8000024b, 0x4000004b, 0xc0000046, 0xc0000082, 0x80000005, 0x40000022, 0x40000002},
- { 0x00000018, 0x80000012, 0x80000009, 0x00000103, 0x00000049, 0x0000004a, 0x00000026, 0x0000011b, 0x80000107, 0x4000004b, 0xc0000046, 0xc0000082, 0x80000005, 0x40000041},
- { 0x00000164, 0x80000202, 0x80000012, 0x80000009, 0x00000103, 0x0000080a, 0x0000004a, 0x8000016d, 0x00000089, 0x80000107, 0x4000004b, 0xc0000046, 0xc0000082, 0x40000022},
- { 0x00000408, 0x00000018, 0x80000202, 0x80000012, 0x80000009, 0x00000060, 0x0000080a, 0x8000041a, 0x00000014, 0x00000089, 0x80000107, 0x4000004b, 0xc0000046, 0x80000005},
- { 0x800000e6, 0x00000164, 0x00000018, 0x80000202, 0x80000012, 0x00000590, 0x00000060, 0x000002e4, 0x8000024b, 0x00000014, 0x00000089, 0x80000107, 0x4000004b, 0xc0000082},
- { 0x8000004c, 0x00000408, 0x00000164, 0x00000018, 0x80000202, 0x00001020, 0x00000590, 0x80000054, 0x0000011b, 0x8000024b, 0x00000014, 0x00000089, 0x80000107, 0xc0000046}
+ { 0x2c000010, 0xb800000a, 0x18000000, 0x0800000c, 0xe8000000, 0xe000002a, 0x60000000, 0x2400001c, 0xb400001c, 0xc0000010, 0x0c000002, 0xcc000014, 0x0400001c, 0x2600001a, 0x00000000, 0x00000000},
+ { 0xf4000014, 0xc8000010, 0xb800000a, 0x18000000, 0x0800000c, 0x20000043, 0xe000002a, 0xec000014, 0x3c000004, 0xb400001c, 0xc0000010, 0x0c000002, 0xcc000014, 0x00000010, 0x00000000, 0x00000000},
+ { 0xb4000008, 0x2c000010, 0xc8000010, 0xb800000a, 0x18000000, 0xb0000040, 0x20000043, 0x0c000002, 0xbc00001a, 0x3c000004, 0xb400001c, 0xc0000010, 0x0c000002, 0x0400001c, 0x00000000, 0x00000000},
+ { 0x08000000, 0xf4000014, 0x2c000010, 0xc8000010, 0xb800000a, 0xd0000053, 0xb0000040, 0xc0000010, 0x20000010, 0xbc00001a, 0x3c000004, 0xb400001c, 0xc0000010, 0xcc000014, 0x00000000, 0x00000000},
+ { 0x9800000c, 0xb4000008, 0xf4000014, 0x2c000010, 0xc8000010, 0xd0000022, 0xd0000053, 0xb400001c, 0x2400001c, 0x20000010, 0xbc00001a, 0x3c000004, 0xb400001c, 0x0c000002, 0x00000000, 0x00000000},
+ { 0xd8000010, 0x08000000, 0xb4000008, 0xf4000014, 0x2c000010, 0x20000000, 0xd0000022, 0x2c000004, 0xec000014, 0x2400001c, 0x20000010, 0xbc00001a, 0x3c000004, 0xc0000010, 0x00000000, 0x00000000},
+ { 0x08000010, 0x9800000c, 0x08000000, 0xb4000008, 0xf4000014, 0x60000032, 0x20000000, 0xbc000018, 0x0c000002, 0xec000014, 0x2400001c, 0x20000010, 0xbc00001a, 0xb400001c, 0x00000000, 0x00000000},
+ { 0xb8000010, 0xd8000010, 0x9800000c, 0x08000000, 0xb4000008, 0x60000043, 0x60000032, 0xb0000010, 0xc0000010, 0x0c000002, 0xec000014, 0x2400001c, 0x20000010, 0x3c000004, 0x00000000, 0x00000000},
+ { 0x98000000, 0x08000010, 0xd8000010, 0x9800000c, 0x08000000, 0x20000040, 0x60000043, 0x0000000c, 0xb400001c, 0xc0000010, 0x0c000002, 0xec000014, 0x2400001c, 0xbc00001a, 0x00000000, 0x00000000},
+ { 0x60000000, 0xb8000010, 0x08000010, 0xd8000010, 0x9800000c, 0xe0000042, 0x20000040, 0xb8000010, 0x2c000004, 0xb400001c, 0xc0000010, 0x0c000002, 0xec000014, 0x20000010, 0x00000000, 0x00000000},
+ { 0x00000008, 0x98000000, 0xb8000010, 0x08000010, 0xd8000010, 0x60000002, 0xe0000042, 0x08000018, 0xbc000018, 0x2c000004, 0xb400001c, 0xc0000010, 0x0c000002, 0x2400001c, 0x00000000, 0x00000000},
+ { 0xc0000000, 0x60000000, 0x98000000, 0xb8000010, 0x08000010, 0x80000001, 0x60000002, 0x78000010, 0xb0000010, 0xbc000018, 0x2c000004, 0xb400001c, 0xc0000010, 0xec000014, 0x00000000, 0x00000000},
+ { 0x90000014, 0x00000008, 0x60000000, 0x98000000, 0xb8000010, 0x00000020, 0x80000001, 0x08000014, 0x0000000c, 0xb0000010, 0xbc000018, 0x2c000004, 0xb400001c, 0x0c000002, 0x00000000, 0x00000000},
+ { 0x10000010, 0xc0000000, 0x00000008, 0x60000000, 0x98000000, 0x00000003, 0x00000020, 0x70000010, 0xb8000010, 0x0000000c, 0xb0000010, 0xbc000018, 0x2c000004, 0xc0000010, 0x00000000, 0x00000000},
+ { 0xb8000014, 0x90000014, 0xc0000000, 0x00000008, 0x60000000, 0x40000052, 0x00000003, 0xb800001c, 0x08000018, 0xb8000010, 0x0000000c, 0xb0000010, 0xbc000018, 0xb400001c, 0x00000000, 0x00000000},
+ { 0x28000000, 0x10000010, 0x90000014, 0xc0000000, 0x00000008, 0x40000040, 0x40000052, 0xe8000000, 0x78000010, 0x08000018, 0xb8000010, 0x0000000c, 0xb0000010, 0x2c000004, 0x00000000, 0x00000000},
+ { 0x20000010, 0xb8000014, 0x10000010, 0x90000014, 0xc0000000, 0xe0000052, 0x40000040, 0xb0000004, 0x08000014, 0x78000010, 0x08000018, 0xb8000010, 0x0000000c, 0xbc000018, 0x00000000, 0x00000000},
+ { 0x48000000, 0x28000000, 0xb8000014, 0x10000010, 0x90000014, 0xa0000000, 0xe0000052, 0x58000010, 0x70000010, 0x08000014, 0x78000010, 0x08000018, 0xb8000010, 0xb0000010, 0x00000000, 0x00000000},
+ { 0x08000018, 0x20000010, 0x28000000, 0xb8000014, 0x10000010, 0x80000040, 0xa0000000, 0xb000000c, 0xb800001c, 0x70000010, 0x08000014, 0x78000010, 0x08000018, 0x0000000c, 0x00000000, 0x00000000},
+ { 0x60000000, 0x48000000, 0x20000010, 0x28000000, 0xb8000014, 0x20000001, 0x80000040, 0x48000000, 0xe8000000, 0xb800001c, 0x70000010, 0x08000014, 0x78000010, 0xb8000010, 0x00000000, 0x00000000},
+ { 0x90000010, 0x08000018, 0x48000000, 0x20000010, 0x28000000, 0x20000060, 0x20000001, 0xb0000000, 0xb0000004, 0xe8000000, 0xb800001c, 0x70000010, 0x08000014, 0x08000018, 0x00000000, 0x00000000},
+ { 0xf0000010, 0x60000000, 0x08000018, 0x48000000, 0x20000010, 0x80000001, 0x20000060, 0xb8000010, 0x58000010, 0xb0000004, 0xe8000000, 0xb800001c, 0x70000010, 0x78000010, 0x00000000, 0x00000000},
+ { 0x90000008, 0x90000010, 0x60000000, 0x08000018, 0x48000000, 0x40000042, 0x80000001, 0x98000010, 0xb000000c, 0x58000010, 0xb0000004, 0xe8000000, 0xb800001c, 0x08000014, 0x00000000, 0x00000000},
+ { 0xc0000000, 0xf0000010, 0x90000010, 0x60000000, 0x08000018, 0xc0000043, 0x40000042, 0xa0000000, 0x48000000, 0xb000000c, 0x58000010, 0xb0000004, 0xe8000000, 0x70000010, 0x00000000, 0x00000000},
+ { 0x90000010, 0x90000008, 0xf0000010, 0x90000010, 0x60000000, 0x40000022, 0xc0000043, 0x00000000, 0xb0000000, 0x48000000, 0xb000000c, 0x58000010, 0xb0000004, 0xb800001c, 0x00000000, 0x00000000},
+ { 0xf0000010, 0xc0000000, 0x90000008, 0xf0000010, 0x90000010, 0x00000003, 0x40000022, 0x00000000, 0xb8000010, 0xb0000000, 0x48000000, 0xb000000c, 0x58000010, 0xe8000000, 0x00000000, 0x00000000},
+ { 0xb0000008, 0x90000010, 0xc0000000, 0x90000008, 0xf0000010, 0x40000042, 0x00000003, 0x20000000, 0x98000010, 0xb8000010, 0xb0000000, 0x48000000, 0xb000000c, 0xb0000004, 0x00000000, 0x00000000},
+ { 0x40000000, 0xf0000010, 0x90000010, 0xc0000000, 0x90000008, 0xc0000043, 0x40000042, 0x80000000, 0xa0000000, 0x98000010, 0xb8000010, 0xb0000000, 0x48000000, 0x58000010, 0x00000000, 0x00000000},
+ { 0x90000000, 0xb0000008, 0xf0000010, 0x90000010, 0xc0000000, 0xc0000022, 0xc0000043, 0x00000010, 0x00000000, 0xa0000000, 0x98000010, 0xb8000010, 0xb0000000, 0xb000000c, 0x00000000, 0x00000000},
+ { 0xf0000010, 0x40000000, 0xb0000008, 0xf0000010, 0x90000010, 0x00000001, 0xc0000022, 0x00000000, 0x00000000, 0x00000000, 0xa0000000, 0x98000010, 0xb8000010, 0x48000000, 0x00000000, 0x00000000},
+ { 0x90000018, 0x90000000, 0x40000000, 0xb0000008, 0xf0000010, 0x40000002, 0x00000001, 0x20000010, 0x20000000, 0x00000000, 0x00000000, 0xa0000000, 0x98000010, 0xb0000000, 0x00000000, 0x00000000},
+ { 0x60000000, 0xf0000010, 0x90000000, 0x40000000, 0xb0000008, 0xc0000043, 0x40000002, 0x20000000, 0x80000000, 0x20000000, 0x00000000, 0x00000000, 0xa0000000, 0xb8000010, 0x00000000, 0x00000000},
+ { 0x90000010, 0x90000018, 0xf0000010, 0x90000000, 0x40000000, 0x40000062, 0xc0000043, 0x00000010, 0x00000010, 0x80000000, 0x20000000, 0x00000000, 0x00000000, 0x98000010, 0x00000000, 0x00000000},
+ { 0x90000010, 0x60000000, 0x90000018, 0xf0000010, 0x90000000, 0x80000001, 0x40000062, 0x60000000, 0x00000000, 0x00000010, 0x80000000, 0x20000000, 0x00000000, 0xa0000000, 0x00000000, 0x00000000},
+ { 0x90000000, 0x90000010, 0x60000000, 0x90000018, 0xf0000010, 0x40000042, 0x80000001, 0x00000018, 0x20000010, 0x00000000, 0x00000010, 0x80000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000},
+ { 0x80000000, 0x90000010, 0x90000010, 0x60000000, 0x90000018, 0x40000042, 0x40000042, 0xe0000000, 0x20000000, 0x20000010, 0x00000000, 0x00000010, 0x80000000, 0x00000000, 0x00000000, 0x00000000},
+ { 0x00000010, 0x90000000, 0x90000010, 0x90000010, 0x60000000, 0x40000002, 0x40000042, 0x90000000, 0x00000010, 0x20000000, 0x20000010, 0x00000000, 0x00000010, 0x20000000, 0x00000000, 0x00000000},
+ { 0xa0000000, 0x80000000, 0x90000000, 0x90000010, 0x90000010, 0x00000002, 0x40000002, 0x30000010, 0x60000000, 0x00000010, 0x20000000, 0x20000010, 0x00000000, 0x80000000, 0x00000000, 0x00000000},
+ { 0x20000000, 0x00000010, 0x80000000, 0x90000000, 0x90000010, 0x00000040, 0x00000002, 0xb0000000, 0x00000018, 0x60000000, 0x00000010, 0x20000000, 0x20000010, 0x00000010, 0x00000000, 0x00000000},
+ { 0xa0000000, 0xa0000000, 0x00000010, 0x80000000, 0x90000000, 0x80000002, 0x00000040, 0x20000000, 0xe0000000, 0x00000018, 0x60000000, 0x00000010, 0x20000000, 0x00000000, 0x00000000, 0x00000000},
+ { 0x20000010, 0x20000000, 0xa0000000, 0x00000010, 0x80000000, 0x80000000, 0x80000002, 0x20000000, 0x90000000, 0xe0000000, 0x00000018, 0x60000000, 0x00000010, 0x20000010, 0x00000000, 0x00000000},
+ { 0x00000000, 0xa0000000, 0x20000000, 0xa0000000, 0x00000010, 0x80000002, 0x80000000, 0xa0000000, 0x30000010, 0x90000000, 0xe0000000, 0x00000018, 0x60000000, 0x20000000, 0x00000000, 0x00000000},
+ { 0x20000010, 0x20000010, 0xa0000000, 0x20000000, 0xa0000000, 0x80000040, 0x80000002, 0x00000010, 0xb0000000, 0x30000010, 0x90000000, 0xe0000000, 0x00000018, 0x00000010, 0x00000000, 0x00000000},
+ { 0x20000000, 0x00000000, 0x20000010, 0xa0000000, 0x20000000, 0x00000000, 0x80000040, 0x80000000, 0x20000000, 0xb0000000, 0x30000010, 0x90000000, 0xe0000000, 0x60000000, 0x00000000, 0x00000000},
+ { 0x00000010, 0x20000010, 0x00000000, 0x20000010, 0xa0000000, 0x80000040, 0x00000000, 0x20000000, 0x20000000, 0x20000000, 0xb0000000, 0x30000010, 0x90000000, 0x00000018, 0x00000000, 0x00000000},
+ { 0x20000000, 0x20000000, 0x20000010, 0x00000000, 0x20000010, 0x80000000, 0x80000040, 0x20000000, 0xa0000000, 0x20000000, 0x20000000, 0xb0000000, 0x30000010, 0xe0000000, 0x00000000, 0x00000000},
+ { 0x00000010, 0x00000010, 0x20000000, 0x20000010, 0x00000000, 0x00000040, 0x80000000, 0x20000000, 0x00000010, 0xa0000000, 0x20000000, 0x20000000, 0xb0000000, 0x90000000, 0x00000000, 0x00000000},
+ { 0xa0000000, 0x20000000, 0x00000010, 0x20000000, 0x20000010, 0x80000000, 0x00000040, 0x80000000, 0x80000000, 0x00000010, 0xa0000000, 0x20000000, 0x20000000, 0x30000010, 0x00000000, 0x00000000},
+ { 0x00000000, 0x00000010, 0x20000000, 0x00000010, 0x20000000, 0x00000040, 0x80000000, 0x00000010, 0x20000000, 0x80000000, 0x00000010, 0xa0000000, 0x20000000, 0xb0000000, 0x00000000, 0x00000000},
+ { 0x20000000, 0xa0000000, 0x00000010, 0x20000000, 0x00000010, 0x80000002, 0x00000040, 0x00000000, 0x20000000, 0x20000000, 0x80000000, 0x00000010, 0xa0000000, 0x20000000, 0x00000000, 0x00000000},
+ { 0x20000000, 0x00000000, 0xa0000000, 0x00000010, 0x20000000, 0x00000000, 0x80000002, 0x20000010, 0x20000000, 0x20000000, 0x20000000, 0x80000000, 0x00000010, 0x20000000, 0x00000000, 0x00000000},
+ { 0x00000000, 0x20000000, 0x00000000, 0xa0000000, 0x00000010, 0x80000000, 0x00000000, 0xa0000000, 0x80000000, 0x20000000, 0x20000000, 0x20000000, 0x80000000, 0xa0000000, 0x00000000, 0x00000000},
+ { 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0xa0000000, 0x80000000, 0x80000000, 0x00000000, 0x00000010, 0x80000000, 0x20000000, 0x20000000, 0x20000000, 0x00000010, 0x00000000, 0x00000000},
+ { 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x80000000, 0x20000000, 0x00000000, 0x00000010, 0x80000000, 0x20000000, 0x20000000, 0x80000000, 0x00000000, 0x00000000},
+ { 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000, 0x20000000, 0x20000010, 0x00000000, 0x00000010, 0x80000000, 0x20000000, 0x20000000, 0x00000000, 0x00000000},
+ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0xa0000000, 0x20000010, 0x00000000, 0x00000010, 0x80000000, 0x20000000, 0x00000000, 0x00000000},
+ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xa0000000, 0x20000010, 0x00000000, 0x00000010, 0x20000000, 0x00000000, 0x00000000},
+ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x00000000, 0xa0000000, 0x20000010, 0x00000000, 0x80000000, 0x00000000, 0x00000000},
+ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0xa0000000, 0x20000010, 0x00000010, 0x00000000, 0x00000000},
+ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0xa0000000, 0x00000000, 0x00000000, 0x00000000},
+ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0x00000000, 0x20000010, 0x00000000, 0x00000000},
+ { 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x20000000, 0xa0000000, 0x00000000, 0x00000000},
+ { 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000},
+ { 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x00000000, 0x00000000},
+ { 0x40000002, 0x00000020, 0x00000001, 0x00000000, 0x00000000, 0x00000080, 0x00000004, 0x40000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x00000000, 0x00000000},
+ { 0x40000040, 0x00000001, 0x00000020, 0x00000001, 0x00000000, 0x00000004, 0x00000080, 0x40000041, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ { 0x40000002, 0x40000002, 0x00000001, 0x00000020, 0x00000001, 0x00000009, 0x00000004, 0x40000022, 0x00000020, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ { 0x80000004, 0x40000040, 0x40000002, 0x00000001, 0x00000020, 0x00000101, 0x00000009, 0x80000005, 0x00000001, 0x00000020, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ { 0x80000080, 0x40000002, 0x40000040, 0x40000002, 0x00000001, 0x00000009, 0x00000101, 0xc0000082, 0x40000002, 0x00000001, 0x00000020, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ { 0x80000006, 0x80000004, 0x40000002, 0x40000040, 0x40000002, 0x00000012, 0x00000009, 0xc0000046, 0x40000041, 0x40000002, 0x00000001, 0x00000020, 0x00000001, 0x00000000, 0x00000000, 0x00000000},
+ { 0x00000049, 0x80000080, 0x80000004, 0x40000002, 0x40000040, 0x00000202, 0x00000012, 0x4000004b, 0x40000022, 0x40000041, 0x40000002, 0x00000001, 0x00000020, 0x00000000, 0x00000000, 0x00000000},
+ { 0x00000103, 0x80000006, 0x80000080, 0x80000004, 0x40000002, 0x0000001a, 0x00000202, 0x80000107, 0x80000005, 0x40000022, 0x40000041, 0x40000002, 0x00000001, 0x00000001, 0x00000000, 0x00000000},
+ { 0x80000009, 0x00000049, 0x80000006, 0x80000080, 0x80000004, 0x00000124, 0x0000001a, 0x00000089, 0xc0000082, 0x80000005, 0x40000022, 0x40000041, 0x40000002, 0x00000020, 0x00000000, 0x00000000},
+ { 0x80000012, 0x00000103, 0x00000049, 0x80000006, 0x80000080, 0x0000040c, 0x00000124, 0x00000014, 0xc0000046, 0xc0000082, 0x80000005, 0x40000022, 0x40000041, 0x00000001, 0x00000000, 0x00000000},
+ { 0x80000202, 0x80000009, 0x00000103, 0x00000049, 0x80000006, 0x00000026, 0x0000040c, 0x8000024b, 0x4000004b, 0xc0000046, 0xc0000082, 0x80000005, 0x40000022, 0x40000002, 0x00000000, 0x00000000},
+ { 0x00000018, 0x80000012, 0x80000009, 0x00000103, 0x00000049, 0x0000004a, 0x00000026, 0x0000011b, 0x80000107, 0x4000004b, 0xc0000046, 0xc0000082, 0x80000005, 0x40000041, 0x00000000, 0x00000000},
+ { 0x00000164, 0x80000202, 0x80000012, 0x80000009, 0x00000103, 0x0000080a, 0x0000004a, 0x8000016d, 0x00000089, 0x80000107, 0x4000004b, 0xc0000046, 0xc0000082, 0x40000022, 0x00000000, 0x00000000},
+ { 0x00000408, 0x00000018, 0x80000202, 0x80000012, 0x80000009, 0x00000060, 0x0000080a, 0x8000041a, 0x00000014, 0x00000089, 0x80000107, 0x4000004b, 0xc0000046, 0x80000005, 0x00000000, 0x00000000},
+ { 0x800000e6, 0x00000164, 0x00000018, 0x80000202, 0x80000012, 0x00000590, 0x00000060, 0x000002e4, 0x8000024b, 0x00000014, 0x00000089, 0x80000107, 0x4000004b, 0xc0000082, 0x00000000, 0x00000000},
+ { 0x8000004c, 0x00000408, 0x00000164, 0x00000018, 0x80000202, 0x00001020, 0x00000590, 0x80000054, 0x0000011b, 0x8000024b, 0x00000014, 0x00000089, 0x80000107, 0xc0000046, 0x00000000, 0x00000000}
};
+uint32_t sha1_dvs_mask58[CNT_SHA1_DVS] = {0};
+uint32_t sha1_dvs_mask65[CNT_SHA1_DVS] = {0};
+
+size_t offset58 = 0;
+size_t offset65 = 0;
+size_t len58 = 0;
+size_t len65 = 0;
+
/*
-static void sha1_process(SHA1_CTX* ctx, const uint32_t block[16])
+static void sha1_process_simd(SHA1_CTX* ctx, const uint32_t block[16])
{
ctx->ihv1[0] = ctx->ihv[0];
ctx->ihv1[1] = ctx->ihv[1];
@@ -112,7 +123,7 @@ static void sha1_process(SHA1_CTX* ctx, const uint32_t block[16])
sha1_recompression_step(sha1_dvs[i].testt, ctx->ihv2, ihvtmp, ctx->m2, ctx->states[sha1_dvs[i].testt]);
- // to verify SHA-1 collision detection code with collisions for reduced-step SHA-1
+ // to verify SHA-1 collision detection code with collisions for reduced-step SHA-1
if ((0 == ((ihvtmp[0] ^ ctx->ihv[0]) | (ihvtmp[1] ^ ctx->ihv[1]) | (ihvtmp[2] ^ ctx->ihv[2]) | (ihvtmp[3] ^ ctx->ihv[3]) | (ihvtmp[4] ^ ctx->ihv[4])))
|| (ctx->reduced_round_coll && 0==((ctx->ihv1[0] ^ ctx->ihv2[0]) | (ctx->ihv1[1] ^ ctx->ihv2[1]) | (ctx->ihv1[2] ^ ctx->ihv2[2]) | (ctx->ihv1[3] ^ ctx->ihv2[3]) | (ctx->ihv1[4] ^ ctx->ihv2[4]))))
{
diff --git a/lib/simd/sha1_simd.cinc b/lib/simd/sha1_simd.cinc
index 073d6ec..036fd56 100644
--- a/lib/simd/sha1_simd.cinc
+++ b/lib/simd/sha1_simd.cinc
@@ -948,3 +948,35 @@ sha1_recompression_simd_type SHA1_RECOMPRESSION_TABLE_SIMD [80] =
SHA1_RECOMPRESSION_SIMD(60), SHA1_RECOMPRESSION_SIMD(61), SHA1_RECOMPRESSION_SIMD(62), SHA1_RECOMPRESSION_SIMD(63), SHA1_RECOMPRESSION_SIMD(64), SHA1_RECOMPRESSION_SIMD(65), SHA1_RECOMPRESSION_SIMD(66), SHA1_RECOMPRESSION_SIMD(67), SHA1_RECOMPRESSION_SIMD(68), SHA1_RECOMPRESSION_SIMD(69),
SHA1_RECOMPRESSION_SIMD(70), SHA1_RECOMPRESSION_SIMD(71), SHA1_RECOMPRESSION_SIMD(72), SHA1_RECOMPRESSION_SIMD(73), SHA1_RECOMPRESSION_SIMD(74), SHA1_RECOMPRESSION_SIMD(75), SHA1_RECOMPRESSION_SIMD(76), SHA1_RECOMPRESSION_SIMD(77), SHA1_RECOMPRESSION_SIMD(78), SHA1_RECOMPRESSION_SIMD(79),
};
+
+void SHA1_APPLY_MESSAGE_DIFFERENCES(const uint32_t me[80], const SIMD_WORD dm[80], SIMD_WORD dme[80])
+{
+ size_t i;
+
+ for (i = 0; i < 80; i++)
+ {
+ dme[i] = SIMD_XOR_VW(dm[i], me[i]);
+ }
+}
+
+void SHA1_COMPARE_DIGESTS(const SHA1_CTX* ctx, const SIMD_WORD ihv_full_collision[5], const SIMD_WORD ihv_reduced_round[5], SIMD_WORD *collision_detected)
+{
+ SIMD_WORD result;
+
+ result = SIMD_XOR_VW(ihv_full_collision[0], ctx->ihv[0]);
+ result = SIMD_OR_VV(result, SIMD_XOR_VW(ihv_full_collision[1], ctx->ihv[1]));
+ result = SIMD_OR_VV(result, SIMD_XOR_VW(ihv_full_collision[2], ctx->ihv[2]));
+ result = SIMD_OR_VV(result, SIMD_XOR_VW(ihv_full_collision[3], ctx->ihv[3]));
+ result = SIMD_OR_VV(result, SIMD_XOR_VW(ihv_full_collision[4], ctx->ihv[4]));
+
+ if (ctx->reduced_round_coll)
+ {
+ result = SIMD_OR_VV(result, SIMD_XOR_VW(ihv_reduced_round[0], ctx->ihv[0]));
+ result = SIMD_OR_VV(result, SIMD_XOR_VW(ihv_reduced_round[1], ctx->ihv[1]));
+ result = SIMD_OR_VV(result, SIMD_XOR_VW(ihv_reduced_round[2], ctx->ihv[2]));
+ result = SIMD_OR_VV(result, SIMD_XOR_VW(ihv_reduced_round[3], ctx->ihv[3]));
+ result = SIMD_OR_VV(result, SIMD_XOR_VW(ihv_reduced_round[4], ctx->ihv[4]));
+ }
+
+ *collision_detected = result;
+}
diff --git a/lib/simd/sha1_simd_avx256.c b/lib/simd/sha1_simd_avx256.c
index 7d5b755..dc23f60 100644
--- a/lib/simd/sha1_simd_avx256.c
+++ b/lib/simd/sha1_simd_avx256.c
@@ -13,12 +13,14 @@
#include "simd_avx256.h"
-#define SHA1_MESSAGE_EXPANSION_SIMD sha1_message_expansion_avx256
-#define SHA1_COMPRESSION_SIMD sha1_avx256
-#define SHA1_COMPRESSION_W_SIMD sha1_W_avx256
-#define SHA1_COMPRESSION_STATES_SIMD sha1_states_avx256
-#define SHA1_RECOMPRESSION_SIMD(t) sha1recompress_fast_ ## t ## _avx256
-#define SHA1_RECOMPRESSION_TABLE_SIMD sha1_recompression_step_avx256
+#define SHA1_MESSAGE_EXPANSION_SIMD sha1_message_expansion_avx256
+#define SHA1_COMPRESSION_SIMD sha1_avx256
+#define SHA1_COMPRESSION_W_SIMD sha1_W_avx256
+#define SHA1_COMPRESSION_STATES_SIMD sha1_states_avx256
+#define SHA1_RECOMPRESSION_SIMD(t) sha1recompress_fast_ ## t ## _avx256
+#define SHA1_RECOMPRESSION_TABLE_SIMD sha1_recompression_step_avx256
+#define SHA1_APPLY_MESSAGE_DIFFERENCES sha1_apply_message_differences_avx256
+#define SHA1_COMPARE_DIGESTS sha1_compre_digests_avx256
#include "sha1_simd.cinc"
diff --git a/lib/simd/sha1_simd_avx512.c b/lib/simd/sha1_simd_avx512.c
index d2f71ed..376fd50 100644
--- a/lib/simd/sha1_simd_avx512.c
+++ b/lib/simd/sha1_simd_avx512.c
@@ -13,12 +13,15 @@
#include "simd_avx512.h"
-#define SHA1_MESSAGE_EXPANSION_SIMD sha1_message_expansion_avx512
-#define SHA1_COMPRESSION_SIMD sha1_avx512
-#define SHA1_COMPRESSION_W_SIMD sha1_W_avx512
-#define SHA1_COMPRESSION_STATES_SIMD sha1_states_avx512
-#define SHA1_RECOMPRESSION_SIMD(t) sha1recompress_fast_ ## t ## _avx512
-#define SHA1_RECOMPRESSION_TABLE_SIMD sha1_recompression_step_avx512
+#define SHA1_MESSAGE_EXPANSION_SIMD sha1_message_expansion_avx512
+#define SHA1_COMPRESSION_SIMD sha1_avx512
+#define SHA1_COMPRESSION_W_SIMD sha1_W_avx512
+#define SHA1_COMPRESSION_STATES_SIMD sha1_states_avx512
+#define SHA1_RECOMPRESSION_SIMD(t) sha1recompress_fast_ ## t ## _avx512
+#define SHA1_RECOMPRESSION_TABLE_SIMD sha1_recompression_step_avx512
+#define SHA1_APPLY_MESSAGE_DIFFERENCES sha1_apply_message_differences_avx512
+#define SHA1_COMPARE_DIGESTS sha1_compare_digests_avx512
+
#include "sha1_simd.cinc"
diff --git a/lib/simd/sha1_simd_mmx64.c b/lib/simd/sha1_simd_mmx64.c
index 9580890..811c716 100644
--- a/lib/simd/sha1_simd_mmx64.c
+++ b/lib/simd/sha1_simd_mmx64.c
@@ -13,12 +13,14 @@
#include "sha1.h"
#include "simd_mmx64.h"
-#define SHA1_MESSAGE_EXPANSION_SIMD sha1_message_expansion_mmx64
-#define SHA1_COMPRESSION_SIMD sha1_mmx64
-#define SHA1_COMPRESSION_W_SIMD sha1_W_mmx64
-#define SHA1_COMPRESSION_STATES_SIMD sha1_states_mmx64
-#define SHA1_RECOMPRESSION_SIMD(t) sha1recompress_fast_ ## t ## _mmx64
-#define SHA1_RECOMPRESSION_TABLE_SIMD sha1_recompression_step_mmx64
+#define SHA1_MESSAGE_EXPANSION_SIMD sha1_message_expansion_mmx64
+#define SHA1_COMPRESSION_SIMD sha1_mmx64
+#define SHA1_COMPRESSION_W_SIMD sha1_W_mmx64
+#define SHA1_COMPRESSION_STATES_SIMD sha1_states_mmx64
+#define SHA1_RECOMPRESSION_SIMD(t) sha1recompress_fast_ ## t ## _mmx64
+#define SHA1_RECOMPRESSION_TABLE_SIMD sha1_recompression_step_mmx64
+#define SHA1_APPLY_MESSAGE_DIFFERENCES sha1_apply_message_differences_mmx64
+#define SHA1_COMPARE_DIGESTS sha1_compare_digests_mmx64
#include "sha1_simd.cinc"
diff --git a/lib/simd/sha1_simd_neon128.c b/lib/simd/sha1_simd_neon128.c
index 429deeb..de16311 100644
--- a/lib/simd/sha1_simd_neon128.c
+++ b/lib/simd/sha1_simd_neon128.c
@@ -13,12 +13,14 @@
#include "simd_neon128.h"
-#define SHA1_MESSAGE_EXPANSION_SIMD sha1_message_expansion_neon128
-#define SHA1_COMPRESSION_SIMD sha1_neon128
-#define SHA1_COMPRESSION_W_SIMD sha1_W_neon128
-#define SHA1_COMPRESSION_STATES_SIMD sha1_states_neon128
-#define SHA1_RECOMPRESSION_SIMD(t) sha1recompress_fast_ ## t ## _neon128
-#define SHA1_RECOMPRESSION_TABLE_SIMD sha1_recompression_step_neon128
+#define SHA1_MESSAGE_EXPANSION_SIMD sha1_message_expansion_neon128
+#define SHA1_COMPRESSION_SIMD sha1_neon128
+#define SHA1_COMPRESSION_W_SIMD sha1_W_neon128
+#define SHA1_COMPRESSION_STATES_SIMD sha1_states_neon128
+#define SHA1_RECOMPRESSION_SIMD(t) sha1recompress_fast_ ## t ## _neon128
+#define SHA1_RECOMPRESSION_TABLE_SIMD sha1_recompression_step_neon128
+#define SHA1_APPLY_MESSAGE_DIFFERENCES sha1_apply_message_differences_neon128
+#define SHA1_COMPARE_DIGESTS sha1_compare_digests_neon128
#include "sha1_simd.cinc"
diff --git a/lib/simd/sha1_simd_sse128.c b/lib/simd/sha1_simd_sse128.c
index b30d271..dac6560 100644
--- a/lib/simd/sha1_simd_sse128.c
+++ b/lib/simd/sha1_simd_sse128.c
@@ -13,12 +13,14 @@
#include "simd_sse128.h"
-#define SHA1_MESSAGE_EXPANSION_SIMD sha1_message_expansion_sse128
-#define SHA1_COMPRESSION_SIMD sha1_sse128
-#define SHA1_COMPRESSION_W_SIMD sha1_W_sse128
-#define SHA1_COMPRESSION_STATES_SIMD sha1_states_sse128
-#define SHA1_RECOMPRESSION_SIMD(t) sha1recompress_fast_ ## t ## _sse128
-#define SHA1_RECOMPRESSION_TABLE_SIMD sha1_recompression_step_sse128
+#define SHA1_MESSAGE_EXPANSION_SIMD sha1_message_expansion_sse128
+#define SHA1_COMPRESSION_SIMD sha1_sse128
+#define SHA1_COMPRESSION_W_SIMD sha1_W_sse128
+#define SHA1_COMPRESSION_STATES_SIMD sha1_states_sse128
+#define SHA1_RECOMPRESSION_SIMD(t) sha1recompress_fast_ ## t ## _sse128
+#define SHA1_RECOMPRESSION_TABLE_SIMD sha1_recompression_step_sse128
+#define SHA1_APPLY_MESSAGE_DIFFERENCES sha1_apply_message_differences_sse128
+#define SHA1_COMPARE_DIGESTS sha1_compare_digests_sse128
#include "sha1_simd.cinc"