]> Git Repo - VerusCoin.git/commitdiff
Portable version fixes
authormiketout <[email protected]>
Tue, 18 Dec 2018 22:19:47 +0000 (14:19 -0800)
committermiketout <[email protected]>
Tue, 18 Dec 2018 22:19:47 +0000 (14:19 -0800)
src/crypto/haraka_portable.c
src/crypto/verus_clhash_portable.cpp
src/crypto/verus_hash.h

index 5d93dbf5ae12f492e2a4f1c296e707fef26fb893..1744c0a17f3a09a232ee13627cd7faac9c805081 100644 (file)
@@ -246,7 +246,7 @@ void haraka512_perm(unsigned char *out, const unsigned char *in)
     memcpy(out, s, 64);\r
 }\r
 \r
-void haraka512_perm_keyed(unsigned char *out, const unsigned char *in, const u128 *_rc) \r
+void haraka512_perm_keyed(unsigned char *out, const unsigned char *in, const u128 *rc) \r
 {\r
     int i, j;\r
 \r
index cf385b0882b0e70598b0ca8cfb80848d31f65012..3021b575c98536ea579611f9a7c253775a2cc5ec 100644 (file)
@@ -306,7 +306,8 @@ static inline __m128i precompReduction64_si128_port( __m128i A) {
 }
 
 static inline uint64_t precompReduction64_port( __m128i A) {
-    return _mm_cvtsi128_si64(precompReduction64_si128_port(A));
+    __m128i tmp = precompReduction64_si128_port(A);
+    return _mm_cvtsi128_si64_emu(tmp);
 }
 
 // verus intermediate hash extra
@@ -573,6 +574,6 @@ uint64_t verusclhash_port(void * random, const unsigned char buf[64], uint64_t k
     const __m128i * string = (const __m128i *) buf;
 
     __m128i  acc = __verusclmulwithoutreduction64alignedrepeat_port(rs64, string, keyMask);
-    acc = _mm_xor_si128(acc, lazyLengthHash_port(1024, 64));
+    acc = _mm_xor_si128_emu(acc, lazyLengthHash_port(1024, 64));
     return precompReduction64_port(acc);
 }
index 1e9f401013a6ffe3a52d7de1281ec456812093bc..01ac2bf3e7d0b227a2407511db1dda111dc3f685 100644 (file)
@@ -223,11 +223,7 @@ class CVerusHashV2
             uint64_t temp = verusclhash_port(verusclhasher_random_data_, curBuf, vclh.keyMask);\r
             FillExtra(&temp);\r
             haraka512_keyed((unsigned char *)&testHash2, curBuf, hashKey + IntermediateTo128Offset(intermediate));\r
-            if (testHash1 == testHash2)\r
-            {\r
-                printf("Portable version passed!");\r
-            }\r
-            else\r
+            if (testHash1 != testHash2)\r
             {\r
                 printf("Portable version failed! intermediate1: %lx, intermediate2: %lx\n", intermediate, temp);\r
             }\r
This page took 0.029184 seconds and 4 git commands to generate.