From 07f7b4b470dc342457ca7a51449e91d232a2f3b2 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Thu, 23 Jun 2005 21:27:13 +0000 Subject: [PATCH] Update for Stratus VOS. PR: 1130 --- crypto/md32_common.h | 8 +++++--- crypto/md4/md4_locl.h | 4 +++- crypto/md5/md5_locl.h | 8 ++++++-- crypto/ripemd/rmd_locl.h | 8 ++++++-- crypto/sha/sha_locl.h | 24 +++++++++++++----------- 5 files changed, 33 insertions(+), 19 deletions(-) diff --git a/crypto/md32_common.h b/crypto/md32_common.h index 0cbcfaf8a2..f1c48b54da 100644 --- a/crypto/md32_common.h +++ b/crypto/md32_common.h @@ -344,9 +344,11 @@ #elif defined(DATA_ORDER_IS_LITTLE_ENDIAN) #if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) - /* See comment in DATA_ORDER_IS_BIG_ENDIAN section. */ -# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, l) -# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, l) +# ifndef B_ENDIAN + /* See comment in DATA_ORDER_IS_BIG_ENDIAN section. */ +# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, l) +# define HOST_l2c(l,c) (*((unsigned int *)(c))=(l), (c)+=4, l) +# endif #endif #ifndef HOST_c2l diff --git a/crypto/md4/md4_locl.h b/crypto/md4/md4_locl.h index 7e219b17ea..abc7b9bb84 100644 --- a/crypto/md4/md4_locl.h +++ b/crypto/md4/md4_locl.h @@ -69,6 +69,7 @@ void md4_block_host_order (MD4_CTX *c, const void *p,size_t num); void md4_block_data_order (MD4_CTX *c, const void *p,size_t num); #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) +# if !defined(B_ENDIAN) /* * *_block_host_order is expected to handle aligned data while * *_block_data_order - unaligned. As algorithm and host (x86) @@ -90,7 +91,8 @@ void md4_block_data_order (MD4_CTX *c, const void *p,size_t num); * * */ -#define md4_block_data_order md4_block_host_order +# define md4_block_data_order md4_block_host_order +# endif #endif #define DATA_ORDER_IS_LITTLE_ENDIAN diff --git a/crypto/md5/md5_locl.h b/crypto/md5/md5_locl.h index 2f5b045f36..94f395f27a 100644 --- a/crypto/md5/md5_locl.h +++ b/crypto/md5/md5_locl.h @@ -67,7 +67,9 @@ #ifdef MD5_ASM # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) || defined(__x86_64) || defined(__x86_64__) -# define md5_block_host_order md5_block_asm_host_order +# if !defined(B_ENDIAN) +# define md5_block_host_order md5_block_asm_host_order +# endif # elif defined(__sparc) && defined(OPENSSL_SYS_ULTRASPARC) void md5_block_asm_data_order_aligned (MD5_CTX *c, const MD5_LONG *p,size_t num); # define HASH_BLOCK_DATA_ORDER_ALIGNED md5_block_asm_data_order_aligned @@ -78,6 +80,7 @@ void md5_block_host_order (MD5_CTX *c, const void *p,size_t num); void md5_block_data_order (MD5_CTX *c, const void *p,size_t num); #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) || defined(__x86_64) || defined(__x86_64__) +# if !defined(B_ENDIAN) /* * *_block_host_order is expected to handle aligned data while * *_block_data_order - unaligned. As algorithm and host (x86) @@ -99,7 +102,8 @@ void md5_block_data_order (MD5_CTX *c, const void *p,size_t num); * * */ -#define md5_block_data_order md5_block_host_order +# define md5_block_data_order md5_block_host_order +# endif #endif #define DATA_ORDER_IS_LITTLE_ENDIAN diff --git a/crypto/ripemd/rmd_locl.h b/crypto/ripemd/rmd_locl.h index 8eb0d288d6..b52d786165 100644 --- a/crypto/ripemd/rmd_locl.h +++ b/crypto/ripemd/rmd_locl.h @@ -72,7 +72,9 @@ */ #ifdef RMD160_ASM # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) -# define ripemd160_block_host_order ripemd160_block_asm_host_order +# if !defined(B_ENDIAN) +# define ripemd160_block_host_order ripemd160_block_asm_host_order +# endif # endif #endif @@ -80,7 +82,9 @@ void ripemd160_block_host_order (RIPEMD160_CTX *c, const void *p,size_t num); void ripemd160_block_data_order (RIPEMD160_CTX *c, const void *p,size_t num); #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) -#define ripemd160_block_data_order ripemd160_block_host_order +# if !defined(B_ENDIAN) +# define ripemd160_block_data_order ripemd160_block_host_order +# endif #endif #define DATA_ORDER_IS_LITTLE_ENDIAN diff --git a/crypto/sha/sha_locl.h b/crypto/sha/sha_locl.h index d1f64c5fd0..4ce2db946b 100644 --- a/crypto/sha/sha_locl.h +++ b/crypto/sha/sha_locl.h @@ -115,17 +115,19 @@ # endif # ifdef SHA1_ASM -# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) -# define sha1_block_host_order sha1_block_asm_host_order -# define DONT_IMPLEMENT_BLOCK_HOST_ORDER -# define sha1_block_data_order sha1_block_asm_data_order -# define DONT_IMPLEMENT_BLOCK_DATA_ORDER -# define HASH_BLOCK_DATA_ORDER_ALIGNED sha1_block_asm_data_order -# elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64) -# define sha1_block_host_order sha1_block_asm_host_order -# define DONT_IMPLEMENT_BLOCK_HOST_ORDER -# define sha1_block_data_order sha1_block_asm_data_order -# define DONT_IMPLEMENT_BLOCK_DATA_ORDER +# if !defined(B_ENDIAN) +# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) +# define sha1_block_host_order sha1_block_asm_host_order +# define DONT_IMPLEMENT_BLOCK_HOST_ORDER +# define sha1_block_data_order sha1_block_asm_data_order +# define DONT_IMPLEMENT_BLOCK_DATA_ORDER +# define HASH_BLOCK_DATA_ORDER_ALIGNED sha1_block_asm_data_order +# elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64) +# define sha1_block_host_order sha1_block_asm_host_order +# define DONT_IMPLEMENT_BLOCK_HOST_ORDER +# define sha1_block_data_order sha1_block_asm_data_order +# define DONT_IMPLEMENT_BLOCK_DATA_ORDER +# endif # endif # endif void sha1_block_host_order (SHA_CTX *c, const void *p,size_t num); -- 2.25.1