aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/slow-hash.c
diff options
context:
space:
mode:
authorNoodleDoodleNoodleDoodleNoodleDoodleNoo <NoodleDoodleNoodleDoodleNoodleDoodleNoo@users.noreply.github.com>2014-06-16 21:13:05 -0700
committerNoodleDoodleNoodleDoodleNoodleDoodleNoo <NoodleDoodleNoodleDoodleNoodleDoodleNoo@users.noreply.github.com>2014-06-16 21:13:05 -0700
commit156312f64adae4a6bdca7b9fc01fa7b3eb8d2452 (patch)
treefccbd9a667661fc0e499e7d283c526032c9a2772 /src/crypto/slow-hash.c
parentUpdate miner.cpp (diff)
downloadmonero-156312f64adae4a6bdca7b9fc01fa7b3eb8d2452.tar.xz
Update slow-hash.c
1. Added multiplication support in 32-bit mode
Diffstat (limited to '')
-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() \