37# if defined( DLL_EXPORT )
38# if defined( _MSC_VER ) || defined ( __INTEL_COMPILER )
39# define VOID_RETURN __declspec( dllexport ) void __stdcall
40# define INT_RETURN __declspec( dllexport ) int __stdcall
41# elif defined( __GNUC__ )
42# define VOID_RETURN __declspec( __dllexport__ ) void
43# define INT_RETURN __declspec( __dllexport__ ) int
45# error Use of the DLL is only available on the Microsoft, Intel and GCC compilers
47# elif defined( DLL_IMPORT )
48# if defined( _MSC_VER ) || defined ( __INTEL_COMPILER )
49# define VOID_RETURN __declspec( dllimport ) void __stdcall
50# define INT_RETURN __declspec( dllimport ) int __stdcall
51# elif defined( __GNUC__ )
52# define VOID_RETURN __declspec( __dllimport__ ) void
53# define INT_RETURN __declspec( __dllimport__ ) int
55# error Use of the DLL is only available on the Microsoft, Intel and GCC compilers
57# elif defined( __WATCOMC__ )
58# define VOID_RETURN void __cdecl
59# define INT_RETURN int __cdecl
61# define VOID_RETURN void
62# define INT_RETURN int
82#define ui_type(size) uint##size##_t
83#define dec_unit_type(size,x) typedef ui_type(size) x
84#define dec_bufr_type(size,bsize,x) typedef ui_type(size) x[bsize / (size >> 3)]
85#define ptr_cast(x,size) ((ui_type(size)*)(x))
92#define RotL_64(x,N) (((x) << (N)) | ((x) >> (64-(N))))
114#ifndef SKEIN_NEED_SWAP
119#define IS_BIG_ENDIAN 4321
120#define IS_LITTLE_ENDIAN 1234
122#if BYTE_ORDER == LITTLE_ENDIAN
123# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
126#if BYTE_ORDER == BIG_ENDIAN
127# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
132#if defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
133# define PLATFORM_MUST_ALIGN (1)
134#ifndef PLATFORM_BYTE_ORDER
135# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
139#ifndef PLATFORM_MUST_ALIGN
140# define PLATFORM_MUST_ALIGN (0)
144#if PLATFORM_BYTE_ORDER == IS_BIG_ENDIAN
146#define SKEIN_NEED_SWAP (1)
147#elif PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN
149#define SKEIN_NEED_SWAP (0)
150#if PLATFORM_MUST_ALIGN == 0
151#define Skein_Put64_LSB_First(dst08,src64,bCnt) memcpy(dst08,src64,bCnt)
152#define Skein_Get64_LSB_First(dst64,src08,wCnt) memcpy(dst64,src08,8*(wCnt))
155#error "Skein needs endianness setting!"
167#define Skein_Swap64(w64) \
168 ( (( ((u64b_t)(w64)) & 0xFF) << 56) | \
169 (((((u64b_t)(w64)) >> 8) & 0xFF) << 48) | \
170 (((((u64b_t)(w64)) >>16) & 0xFF) << 40) | \
171 (((((u64b_t)(w64)) >>24) & 0xFF) << 32) | \
172 (((((u64b_t)(w64)) >>32) & 0xFF) << 24) | \
173 (((((u64b_t)(w64)) >>40) & 0xFF) << 16) | \
174 (((((u64b_t)(w64)) >>48) & 0xFF) << 8) | \
175 (((((u64b_t)(w64)) >>56) & 0xFF) ) )
177#define Skein_Swap64(w64) (w64)
182#ifndef Skein_Put64_LSB_First
184#ifdef SKEIN_PORT_CODE
189 dst[n] = (
u08b_t) (src[n>>3] >> (8*(n&7)));
197#ifndef Skein_Get64_LSB_First
199#ifdef SKEIN_PORT_CODE
203 for (n=0;n<8*wCnt;n+=8)
204 dst[n/8] = (((
u64b_t) src[n ]) ) +
205 (((
u64b_t) src[n+1]) << 8) +
206 (((
u64b_t) src[n+2]) << 16) +
207 (((
u64b_t) src[n+3]) << 24) +
208 (((
u64b_t) src[n+4]) << 32) +
209 (((
u64b_t) src[n+5]) << 40) +
210 (((
u64b_t) src[n+6]) << 48) +
211 (((
u64b_t) src[n+7]) << 56) ;
void Skein_Put64_LSB_First(u08b_t *dst, const u64b_t *src, size_t bCnt)
unsigned int uint_t
Definition skein_port.h:87
void Skein_Get64_LSB_First(u64b_t *dst, const u08b_t *src, size_t wCnt)
uint8_t u08b_t
Definition skein_port.h:88
uint64_t u64b_t
Definition skein_port.h:89
unsigned char uint8_t
Definition stdint.h:124
unsigned __int64 uint64_t
Definition stdint.h:136