Merge pull request #11 from batmaninpink/osx

fix scrypt-jane OS X compile
This commit is contained in:
Daniel Larimer 2014-02-21 15:06:46 -05:00
commit afe9874cba
3 changed files with 18 additions and 8 deletions

View file

@ -5,21 +5,17 @@
#include <openssl/evp.h>
/*
#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<unsigned char> &passphrase, const std::vector<unsigned char> &salt,
unsigned int n, unsigned int r, unsigned int p, std::vector<unsigned char> &key )
{
FC_ASSERT( !"Does not compile on OS X" );
/*
unsigned int chunk_bytes = SCRYPT_BLOCK_BYTES * r * 2;
std::vector<unsigned char> 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

View file

@ -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) */
#endif /* defined(CPU_X86) || defined(CPU_X86_64) */

View file

@ -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 <stdint.h>
#endif
#if defined(__MINGW32__) || defined(__MINGW64__)