aboutsummaryrefslogtreecommitdiff
path: root/src/scrypt.h
diff options
context:
space:
mode:
authorummjackson <[email protected]>2014-01-23 19:30:28 +1100
committerummjackson <[email protected]>2014-01-23 19:30:28 +1100
commit4d5e616b96f2f2bfdaf181e1c18dda87c5a6af4c (patch)
treef8ce760bdce68640f01ce662d0beadc75ffa59d6 /src/scrypt.h
parentLitecoin clean up + removed stray thumbs.db (diff)
downloaddiscoin-4d5e616b96f2f2bfdaf181e1c18dda87c5a6af4c.tar.xz
discoin-4d5e616b96f2f2bfdaf181e1c18dda87c5a6af4c.zip
Bringing /src/ up to speed with 0.8.6.2
Diffstat (limited to 'src/scrypt.h')
-rw-r--r--src/scrypt.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/scrypt.h b/src/scrypt.h
index 5627e2182..baa928b57 100644
--- a/src/scrypt.h
+++ b/src/scrypt.h
@@ -4,15 +4,25 @@
#define SCRYPT_H
#include <stdlib.h>
#include <stdint.h>
+
static const int SCRYPT_SCRATCHPAD_SIZE = 131072 + 63;
void scrypt_1024_1_1_256(const char *input, char *output);
void scrypt_1024_1_1_256_sp_generic(const char *input, char *output, char *scratchpad);
#if defined(USE_SSE2)
-extern void scrypt_detect_sse2(unsigned int cpuid_edx);
+#if defined(_M_X64) || defined(__x86_64__) || defined(_M_AMD64) || (defined(MAC_OSX) && defined(__i386__))
+#define USE_SSE2_ALWAYS 1
+#define scrypt_1024_1_1_256_sp(input, output, scratchpad) scrypt_1024_1_1_256_sp_sse2((input), (output), (scratchpad))
+#else
+#define scrypt_1024_1_1_256_sp(input, output, scratchpad) scrypt_1024_1_1_256_sp_detected((input), (output), (scratchpad))
+#endif
+
+void scrypt_detect_sse2();
void scrypt_1024_1_1_256_sp_sse2(const char *input, char *output, char *scratchpad);
-extern void (*scrypt_1024_1_1_256_sp)(const char *input, char *output, char *scratchpad);
+extern void (*scrypt_1024_1_1_256_sp_detected)(const char *input, char *output, char *scratchpad);
+#else
+#define scrypt_1024_1_1_256_sp(input, output, scratchpad) scrypt_1024_1_1_256_sp_generic((input), (output), (scratchpad))
#endif
void
@@ -34,4 +44,4 @@ static inline void le32enc(void *pp, uint32_t x)
p[2] = (x >> 16) & 0xff;
p[3] = (x >> 24) & 0xff;
}
-#endif
+#endif \ No newline at end of file