diff --git a/src/crypto/scrypt.cpp b/src/crypto/scrypt.cpp index 65edf8c..5eebe39 100644 --- a/src/crypto/scrypt.cpp +++ b/src/crypto/scrypt.cpp @@ -5,10 +5,10 @@ #include -/* #define SCRYPT_SALSA 1 #define SCRYPT_SHA256 1 +/* #include "code/scrypt-jane-portable.h" #include "code/scrypt-jane-romix.h" */ @@ -18,7 +18,6 @@ namespace fc { void scrypt_derive_key( const std::vector &passphrase, const std::vector &salt, unsigned int n, unsigned int r, unsigned int p, std::vector &key ) { - FC_ASSERT( !"Does not compile on OS X" ); /* unsigned int chunk_bytes = SCRYPT_BLOCK_BYTES * r * 2; std::vector yx((p+1) * chunk_bytes); diff --git a/vendor/scrypt-jane/code/scrypt-jane-portable-x86.h b/vendor/scrypt-jane/code/scrypt-jane-portable-x86.h index 396a7bd..5cb7ec5 100644 --- a/vendor/scrypt-jane/code/scrypt-jane-portable-x86.h +++ b/vendor/scrypt-jane/code/scrypt-jane-portable-x86.h @@ -459,4 +459,4 @@ get_top_cpuflag_desc(size_t flag) { #endif #endif -#endif /* defined(CPU_X86) || defined(CPU_X86_64) */ \ No newline at end of file +#endif /* defined(CPU_X86) || defined(CPU_X86_64) */ diff --git a/vendor/scrypt-jane/code/scrypt-jane-portable.h b/vendor/scrypt-jane/code/scrypt-jane-portable.h index e83e314..d280a1b 100644 --- a/vendor/scrypt-jane/code/scrypt-jane-portable.h +++ b/vendor/scrypt-jane/code/scrypt-jane-portable.h @@ -136,7 +136,7 @@ #define CDECL __attribute__((cdecl)) #undef STDCALL #define STDCALL __attribute__((stdcall)) - #define ALIGN(n) __attribute__((aligned(n))) + #define ALIGN(n) __attribute__((aligned(n))) #include #endif #if defined(__MINGW32__) || defined(__MINGW64__) @@ -300,7 +300,14 @@ scrypt_ensure_zero(void *p, size_t len) { #endif } +#if defined(MACOS_X) || (defined(__APPLE__) & defined(__MACH__)) +static size_t +detect_cpu(void) { + return 0; +} +#else #include "scrypt-jane-portable-x86.h" +#endif #if !defined(asm_calling_convention) #define asm_calling_convention