summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/md5/md5_locl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/md5/md5_locl.h')
-rw-r--r--src/lib/libcrypto/md5/md5_locl.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lib/libcrypto/md5/md5_locl.h b/src/lib/libcrypto/md5/md5_locl.h
index 9d04696dbd..06af633228 100644
--- a/src/lib/libcrypto/md5/md5_locl.h
+++ b/src/lib/libcrypto/md5/md5_locl.h
@@ -66,7 +66,7 @@
66#endif 66#endif
67 67
68#ifdef MD5_ASM 68#ifdef MD5_ASM
69# if defined(__i386) || defined(_M_IX86) 69# if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
70# define md5_block_host_order md5_block_asm_host_order 70# define md5_block_host_order md5_block_asm_host_order
71# elif defined(__sparc) && defined(ULTRASPARC) 71# elif defined(__sparc) && defined(ULTRASPARC)
72 void md5_block_asm_data_order_aligned (MD5_CTX *c, const MD5_LONG *p,int num); 72 void md5_block_asm_data_order_aligned (MD5_CTX *c, const MD5_LONG *p,int num);
@@ -77,11 +77,11 @@
77void md5_block_host_order (MD5_CTX *c, const void *p,int num); 77void md5_block_host_order (MD5_CTX *c, const void *p,int num);
78void md5_block_data_order (MD5_CTX *c, const void *p,int num); 78void md5_block_data_order (MD5_CTX *c, const void *p,int num);
79 79
80#if defined(__i386) || defined(_M_IX86) 80#if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
81/* 81/*
82 * *_block_host_order is expected to handle aligned data while 82 * *_block_host_order is expected to handle aligned data while
83 * *_block_data_order - unaligned. As algorithm and host (x86) 83 * *_block_data_order - unaligned. As algorithm and host (x86)
84 * are in this case of the same "endianess" these two are 84 * are in this case of the same "endianness" these two are
85 * otherwise indistinguishable. But normally you don't want to 85 * otherwise indistinguishable. But normally you don't want to
86 * call the same function because unaligned access in places 86 * call the same function because unaligned access in places
87 * where alignment is expected is usually a "Bad Thing". Indeed, 87 * where alignment is expected is usually a "Bad Thing". Indeed,
@@ -112,6 +112,13 @@ void md5_block_data_order (MD5_CTX *c, const void *p,int num);
112#define HASH_UPDATE MD5_Update 112#define HASH_UPDATE MD5_Update
113#define HASH_TRANSFORM MD5_Transform 113#define HASH_TRANSFORM MD5_Transform
114#define HASH_FINAL MD5_Final 114#define HASH_FINAL MD5_Final
115#define HASH_MAKE_STRING(c,s) do { \
116 unsigned long ll; \
117 ll=(c)->A; HOST_l2c(ll,(s)); \
118 ll=(c)->B; HOST_l2c(ll,(s)); \
119 ll=(c)->C; HOST_l2c(ll,(s)); \
120 ll=(c)->D; HOST_l2c(ll,(s)); \
121 } while (0)
115#define HASH_BLOCK_HOST_ORDER md5_block_host_order 122#define HASH_BLOCK_HOST_ORDER md5_block_host_order
116#if !defined(L_ENDIAN) || defined(md5_block_data_order) 123#if !defined(L_ENDIAN) || defined(md5_block_data_order)
117#define HASH_BLOCK_DATA_ORDER md5_block_data_order 124#define HASH_BLOCK_DATA_ORDER md5_block_data_order
@@ -119,7 +126,7 @@ void md5_block_data_order (MD5_CTX *c, const void *p,int num);
119 * Little-endians (Intel and Alpha) feel better without this. 126 * Little-endians (Intel and Alpha) feel better without this.
120 * It looks like memcpy does better job than generic 127 * It looks like memcpy does better job than generic
121 * md5_block_data_order on copying-n-aligning input data. 128 * md5_block_data_order on copying-n-aligning input data.
122 * But franlky speaking I didn't expect such result on Alpha. 129 * But frankly speaking I didn't expect such result on Alpha.
123 * On the other hand I've got this with egcs-1.0.2 and if 130 * On the other hand I've got this with egcs-1.0.2 and if
124 * program is compiled with another (better?) compiler it 131 * program is compiled with another (better?) compiler it
125 * might turn out other way around. 132 * might turn out other way around.
@@ -140,7 +147,7 @@ void md5_block_data_order (MD5_CTX *c, const void *p,int num);
140*/ 147*/
141 148
142/* As pointed out by Wei Dai <weidai@eskimo.com>, the above can be 149/* As pointed out by Wei Dai <weidai@eskimo.com>, the above can be
143 * simplified to the code below. Wei attributes these optimisations 150 * simplified to the code below. Wei attributes these optimizations
144 * to Peter Gutmann's SHS code, and he attributes it to Rich Schroeppel. 151 * to Peter Gutmann's SHS code, and he attributes it to Rich Schroeppel.
145 */ 152 */
146#define F(b,c,d) ((((c) ^ (d)) & (b)) ^ (d)) 153#define F(b,c,d) ((((c) ^ (d)) & (b)) ^ (d))