aboutsummaryrefslogtreecommitdiff
path: root/src/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/slow-hash.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/crypto/slow-hash.c b/src/crypto/slow-hash.c
index cda66af52..46a5b5f30 100644
--- a/src/crypto/slow-hash.c
+++ b/src/crypto/slow-hash.c
@@ -49,13 +49,20 @@
#define U64(x) ((uint64_t *) (x))
#define R128(x) ((__m128i *) (x))
-#define SWAP(a, b) (((a) -= (b)), ((b) += (a)), ((a) = (b) - (a)))
#define state_index(x) (((*((uint64_t *)x) >> 4) & (TOTALBLOCKS - 1)) << 4)
#if defined(_MSC_VER)
+#if !defined(_WIN64)
+#define __mul() lo = mul128(c[0], b[0], &hi);
+#else
#define __mul() lo = _umul128(c[0], b[0], &hi);
+#endif
#else
+#if defined(__x86_64__)
#define __mul() ASM("mulq %3\n\t" : "=d"(hi), "=a"(lo) : "%a" (c[0]), "rm" (b[0]) : "cc");
+#else
+#define __mul() lo = mul128(c[0], b[0], &hi);
+#endif
#endif
#define pre_aes() \