diff --git a/src/crypto/scrypt.cpp b/src/crypto/scrypt.cpp index 65edf8c..8e1e1b5 100644 --- a/src/crypto/scrypt.cpp +++ b/src/crypto/scrypt.cpp @@ -5,21 +5,17 @@ #include -/* #define SCRYPT_SALSA 1 #define SCRYPT_SHA256 1 #include "code/scrypt-jane-portable.h" #include "code/scrypt-jane-romix.h" -*/ 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); @@ -52,7 +48,6 @@ namespace fc { std::fill( yx.begin(), yx.end(), 0 ); std::fill( v.begin(), v.end(), 0 ); - */ } } // namespace fc diff --git a/vendor/scrypt-jane/code/scrypt-jane-portable-x86.h b/vendor/scrypt-jane/code/scrypt-jane-portable-x86.h index 396a7bd..022c541 100644 --- a/vendor/scrypt-jane/code/scrypt-jane-portable-x86.h +++ b/vendor/scrypt-jane/code/scrypt-jane-portable-x86.h @@ -179,8 +179,11 @@ #define GNU_AS3(x, y, z) #x ", " #y ", " #z ";\n" #define GNU_AS4(x, y, z, w) #x ", " #y ", " #z ", " #w ";\n" #define GNU_ASFN(x) "\n_" #x ":\n" #x ":\n" +#if defined(MACOS_X) || (defined(__APPLE__) & defined(__MACH__)) + #define GNU_ASJ(x) #x "\n" +#else #define GNU_ASJ(x) ".att_syntax prefix\n" #x "\n.intel_syntax noprefix\n" - +#endif #define a1(x) GNU_AS1(x) #define a2(x, y) GNU_AS2(x, y) #define a3(x, y, z) GNU_AS3(x, y, z) @@ -236,10 +239,17 @@ #endif #define asm_naked_fn_proto(type, fn) extern type asm_calling_convention fn +#if defined(MACOS_X) || (defined(__APPLE__) & defined(__MACH__)) + #define asm_naked_fn_end(fn) ); + + #define asm_gcc() __asm__ __volatile__( + #define asm_gcc_parms() +#else #define asm_naked_fn_end(fn) ".att_syntax prefix;\n" ); #define asm_gcc() __asm__ __volatile__(".intel_syntax noprefix;\n" #define asm_gcc_parms() ".att_syntax prefix;" +#endif #define asm_gcc_trashed() __asm__ __volatile__("" ::: #define asm_gcc_end() ); #else @@ -459,4 +469,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..b9afeef 100644 --- a/vendor/scrypt-jane/code/scrypt-jane-portable.h +++ b/vendor/scrypt-jane/code/scrypt-jane-portable.h @@ -136,7 +136,12 @@ #define CDECL __attribute__((cdecl)) #undef STDCALL #define STDCALL __attribute__((stdcall)) - #define ALIGN(n) __attribute__((aligned(n))) +#if defined(MACOS_X) || (defined(__APPLE__) & defined(__MACH__)) + #undef ALIGN + #define ALIGN(n) +#else + #define ALIGN(n) __attribute__((aligned(n))) +#endif #include #endif #if defined(__MINGW32__) || defined(__MINGW64__)