diff options
author | beck <> | 2000-03-19 11:13:58 +0000 |
---|---|---|
committer | beck <> | 2000-03-19 11:13:58 +0000 |
commit | 796d609550df3a33fc11468741c5d2f6d3df4c11 (patch) | |
tree | 6c6d539061caa20372dad0ac4ddb1dfae2fbe7fe /src/lib/libcrypto/md5 | |
parent | 5be3114c1fd7e0dfea1e38d3abb4cbba75244419 (diff) | |
download | openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.gz openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.tar.bz2 openbsd-796d609550df3a33fc11468741c5d2f6d3df4c11.zip |
OpenSSL 0.9.5 merge
*warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2
if you are using the ssl26 packages for ssh and other things to work you will
need to get new ones (see ~beck/libsslsnap/<arch>) on cvs or ~beck/src-patent.tar.gz on cvs
Diffstat (limited to 'src/lib/libcrypto/md5')
-rw-r--r-- | src/lib/libcrypto/md5/Makefile.ssl | 9 | ||||
-rw-r--r-- | src/lib/libcrypto/md5/md5.h | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/md5/md5_dgst.c | 154 | ||||
-rw-r--r-- | src/lib/libcrypto/md5/md5_locl.h | 17 | ||||
-rw-r--r-- | src/lib/libcrypto/md5/md5_one.c | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/md5/md5test.c | 4 |
6 files changed, 103 insertions, 87 deletions
diff --git a/src/lib/libcrypto/md5/Makefile.ssl b/src/lib/libcrypto/md5/Makefile.ssl index cc73fba2ba..d50f967be7 100644 --- a/src/lib/libcrypto/md5/Makefile.ssl +++ b/src/lib/libcrypto/md5/Makefile.ssl | |||
@@ -19,6 +19,13 @@ AR= ar r | |||
19 | MD5_ASM_OBJ= | 19 | MD5_ASM_OBJ= |
20 | 20 | ||
21 | CFLAGS= $(INCLUDES) $(CFLAG) | 21 | CFLAGS= $(INCLUDES) $(CFLAG) |
22 | |||
23 | # We let the C compiler driver to take care of .s files. This is done in | ||
24 | # order to be excused from maintaining a separate set of architecture | ||
25 | # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC | ||
26 | # gcc, then the driver will automatically translate it to -xarch=v8plus | ||
27 | # and pass it down to assembler. | ||
28 | AS=$(CC) -c | ||
22 | ASFLAGS=$(CFLAGS) | 29 | ASFLAGS=$(CFLAGS) |
23 | 30 | ||
24 | GENERAL=Makefile | 31 | GENERAL=Makefile |
@@ -77,7 +84,7 @@ asm/md5-sparcv8plus.o: asm/md5-sparcv9.S | |||
77 | # if they didn't bother to upgrade GNU assembler. Such users should | 84 | # if they didn't bother to upgrade GNU assembler. Such users should |
78 | # not choose this option, but be adviced to *remove* GNU assembler | 85 | # not choose this option, but be adviced to *remove* GNU assembler |
79 | # or upgrade it. | 86 | # or upgrade it. |
80 | sm/md5-sparcv8plus-gcc27.o: asm/md5-sparcv9.S | 87 | asm/md5-sparcv8plus-gcc27.o: asm/md5-sparcv9.S |
81 | $(CC) $(ASFLAGS) -DMD5_BLOCK_DATA_ORDER -E asm/md5-sparcv9.S | \ | 88 | $(CC) $(ASFLAGS) -DMD5_BLOCK_DATA_ORDER -E asm/md5-sparcv9.S | \ |
82 | /usr/ccs/bin/as -xarch=v8plus - -o asm/md5-sparcv8plus-gcc27.o | 89 | /usr/ccs/bin/as -xarch=v8plus - -o asm/md5-sparcv8plus-gcc27.o |
83 | 90 | ||
diff --git a/src/lib/libcrypto/md5/md5.h b/src/lib/libcrypto/md5/md5.h index bdab6d45e8..d10bc8397f 100644 --- a/src/lib/libcrypto/md5/md5.h +++ b/src/lib/libcrypto/md5/md5.h | |||
@@ -103,9 +103,9 @@ typedef struct MD5state_st | |||
103 | } MD5_CTX; | 103 | } MD5_CTX; |
104 | 104 | ||
105 | void MD5_Init(MD5_CTX *c); | 105 | void MD5_Init(MD5_CTX *c); |
106 | void MD5_Update(MD5_CTX *c, const unsigned char *data, unsigned long len); | 106 | void MD5_Update(MD5_CTX *c, const void *data, unsigned long len); |
107 | void MD5_Final(unsigned char *md, MD5_CTX *c); | 107 | void MD5_Final(unsigned char *md, MD5_CTX *c); |
108 | unsigned char *MD5(unsigned char *d, unsigned long n, unsigned char *md); | 108 | unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md); |
109 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); | 109 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); |
110 | #ifdef __cplusplus | 110 | #ifdef __cplusplus |
111 | } | 111 | } |
diff --git a/src/lib/libcrypto/md5/md5_dgst.c b/src/lib/libcrypto/md5/md5_dgst.c index ba0115ae79..23d196b8d4 100644 --- a/src/lib/libcrypto/md5/md5_dgst.c +++ b/src/lib/libcrypto/md5/md5_dgst.c | |||
@@ -60,7 +60,7 @@ | |||
60 | #include "md5_locl.h" | 60 | #include "md5_locl.h" |
61 | #include <openssl/opensslv.h> | 61 | #include <openssl/opensslv.h> |
62 | 62 | ||
63 | char *MD5_version="MD5" OPENSSL_VERSION_PTEXT; | 63 | const char *MD5_version="MD5" OPENSSL_VERSION_PTEXT; |
64 | 64 | ||
65 | /* Implemented from RFC1321 The MD5 Message-Digest Algorithm | 65 | /* Implemented from RFC1321 The MD5 Message-Digest Algorithm |
66 | */ | 66 | */ |
@@ -186,6 +186,9 @@ void md5_block_host_order (MD5_CTX *c, const void *data, int num) | |||
186 | #endif | 186 | #endif |
187 | 187 | ||
188 | #ifndef md5_block_data_order | 188 | #ifndef md5_block_data_order |
189 | #ifdef X | ||
190 | #undef X | ||
191 | #endif | ||
189 | void md5_block_data_order (MD5_CTX *c, const void *data_, int num) | 192 | void md5_block_data_order (MD5_CTX *c, const void *data_, int num) |
190 | { | 193 | { |
191 | const unsigned char *data=data_; | 194 | const unsigned char *data=data_; |
@@ -204,16 +207,15 @@ void md5_block_data_order (MD5_CTX *c, const void *data_, int num) | |||
204 | * | 207 | * |
205 | * <appro@fy.chalmers.se> | 208 | * <appro@fy.chalmers.se> |
206 | */ | 209 | */ |
207 | MD5_LONG X[MD5_LBLOCK]; | 210 | #ifndef MD32_XARRAY |
208 | /* | 211 | /* See comment in crypto/sha/sha_locl.h for details. */ |
209 | * In case you wonder why don't I use c->data for this. | 212 | unsigned long XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, |
210 | * RISCs usually have a handful of registers and if X is | 213 | XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15; |
211 | * declared as automatic array good optimizing compiler | 214 | # define X(i) XX##i |
212 | * shall accomodate at least part of it in register bank | 215 | #else |
213 | * instead of memory. | 216 | MD5_LONG XX[MD5_LBLOCK]; |
214 | * | 217 | # define X(i) XX[i] |
215 | * <appro@fy.chalmers.se> | 218 | #endif |
216 | */ | ||
217 | 219 | ||
218 | A=c->A; | 220 | A=c->A; |
219 | B=c->B; | 221 | B=c->B; |
@@ -222,75 +224,75 @@ void md5_block_data_order (MD5_CTX *c, const void *data_, int num) | |||
222 | 224 | ||
223 | for (;num--;) | 225 | for (;num--;) |
224 | { | 226 | { |
225 | HOST_c2l(data,l); X[ 0]=l; HOST_c2l(data,l); X[ 1]=l; | 227 | HOST_c2l(data,l); X( 0)=l; HOST_c2l(data,l); X( 1)=l; |
226 | /* Round 0 */ | 228 | /* Round 0 */ |
227 | R0(A,B,C,D,X[ 0], 7,0xd76aa478L); HOST_c2l(data,l); X[ 2]=l; | 229 | R0(A,B,C,D,X( 0), 7,0xd76aa478L); HOST_c2l(data,l); X( 2)=l; |
228 | R0(D,A,B,C,X[ 1],12,0xe8c7b756L); HOST_c2l(data,l); X[ 3]=l; | 230 | R0(D,A,B,C,X( 1),12,0xe8c7b756L); HOST_c2l(data,l); X( 3)=l; |
229 | R0(C,D,A,B,X[ 2],17,0x242070dbL); HOST_c2l(data,l); X[ 4]=l; | 231 | R0(C,D,A,B,X( 2),17,0x242070dbL); HOST_c2l(data,l); X( 4)=l; |
230 | R0(B,C,D,A,X[ 3],22,0xc1bdceeeL); HOST_c2l(data,l); X[ 5]=l; | 232 | R0(B,C,D,A,X( 3),22,0xc1bdceeeL); HOST_c2l(data,l); X( 5)=l; |
231 | R0(A,B,C,D,X[ 4], 7,0xf57c0fafL); HOST_c2l(data,l); X[ 6]=l; | 233 | R0(A,B,C,D,X( 4), 7,0xf57c0fafL); HOST_c2l(data,l); X( 6)=l; |
232 | R0(D,A,B,C,X[ 5],12,0x4787c62aL); HOST_c2l(data,l); X[ 7]=l; | 234 | R0(D,A,B,C,X( 5),12,0x4787c62aL); HOST_c2l(data,l); X( 7)=l; |
233 | R0(C,D,A,B,X[ 6],17,0xa8304613L); HOST_c2l(data,l); X[ 8]=l; | 235 | R0(C,D,A,B,X( 6),17,0xa8304613L); HOST_c2l(data,l); X( 8)=l; |
234 | R0(B,C,D,A,X[ 7],22,0xfd469501L); HOST_c2l(data,l); X[ 9]=l; | 236 | R0(B,C,D,A,X( 7),22,0xfd469501L); HOST_c2l(data,l); X( 9)=l; |
235 | R0(A,B,C,D,X[ 8], 7,0x698098d8L); HOST_c2l(data,l); X[10]=l; | 237 | R0(A,B,C,D,X( 8), 7,0x698098d8L); HOST_c2l(data,l); X(10)=l; |
236 | R0(D,A,B,C,X[ 9],12,0x8b44f7afL); HOST_c2l(data,l); X[11]=l; | 238 | R0(D,A,B,C,X( 9),12,0x8b44f7afL); HOST_c2l(data,l); X(11)=l; |
237 | R0(C,D,A,B,X[10],17,0xffff5bb1L); HOST_c2l(data,l); X[12]=l; | 239 | R0(C,D,A,B,X(10),17,0xffff5bb1L); HOST_c2l(data,l); X(12)=l; |
238 | R0(B,C,D,A,X[11],22,0x895cd7beL); HOST_c2l(data,l); X[13]=l; | 240 | R0(B,C,D,A,X(11),22,0x895cd7beL); HOST_c2l(data,l); X(13)=l; |
239 | R0(A,B,C,D,X[12], 7,0x6b901122L); HOST_c2l(data,l); X[14]=l; | 241 | R0(A,B,C,D,X(12), 7,0x6b901122L); HOST_c2l(data,l); X(14)=l; |
240 | R0(D,A,B,C,X[13],12,0xfd987193L); HOST_c2l(data,l); X[15]=l; | 242 | R0(D,A,B,C,X(13),12,0xfd987193L); HOST_c2l(data,l); X(15)=l; |
241 | R0(C,D,A,B,X[14],17,0xa679438eL); | 243 | R0(C,D,A,B,X(14),17,0xa679438eL); |
242 | R0(B,C,D,A,X[15],22,0x49b40821L); | 244 | R0(B,C,D,A,X(15),22,0x49b40821L); |
243 | /* Round 1 */ | 245 | /* Round 1 */ |
244 | R1(A,B,C,D,X[ 1], 5,0xf61e2562L); | 246 | R1(A,B,C,D,X( 1), 5,0xf61e2562L); |
245 | R1(D,A,B,C,X[ 6], 9,0xc040b340L); | 247 | R1(D,A,B,C,X( 6), 9,0xc040b340L); |
246 | R1(C,D,A,B,X[11],14,0x265e5a51L); | 248 | R1(C,D,A,B,X(11),14,0x265e5a51L); |
247 | R1(B,C,D,A,X[ 0],20,0xe9b6c7aaL); | 249 | R1(B,C,D,A,X( 0),20,0xe9b6c7aaL); |
248 | R1(A,B,C,D,X[ 5], 5,0xd62f105dL); | 250 | R1(A,B,C,D,X( 5), 5,0xd62f105dL); |
249 | R1(D,A,B,C,X[10], 9,0x02441453L); | 251 | R1(D,A,B,C,X(10), 9,0x02441453L); |
250 | R1(C,D,A,B,X[15],14,0xd8a1e681L); | 252 | R1(C,D,A,B,X(15),14,0xd8a1e681L); |
251 | R1(B,C,D,A,X[ 4],20,0xe7d3fbc8L); | 253 | R1(B,C,D,A,X( 4),20,0xe7d3fbc8L); |
252 | R1(A,B,C,D,X[ 9], 5,0x21e1cde6L); | 254 | R1(A,B,C,D,X( 9), 5,0x21e1cde6L); |
253 | R1(D,A,B,C,X[14], 9,0xc33707d6L); | 255 | R1(D,A,B,C,X(14), 9,0xc33707d6L); |
254 | R1(C,D,A,B,X[ 3],14,0xf4d50d87L); | 256 | R1(C,D,A,B,X( 3),14,0xf4d50d87L); |
255 | R1(B,C,D,A,X[ 8],20,0x455a14edL); | 257 | R1(B,C,D,A,X( 8),20,0x455a14edL); |
256 | R1(A,B,C,D,X[13], 5,0xa9e3e905L); | 258 | R1(A,B,C,D,X(13), 5,0xa9e3e905L); |
257 | R1(D,A,B,C,X[ 2], 9,0xfcefa3f8L); | 259 | R1(D,A,B,C,X( 2), 9,0xfcefa3f8L); |
258 | R1(C,D,A,B,X[ 7],14,0x676f02d9L); | 260 | R1(C,D,A,B,X( 7),14,0x676f02d9L); |
259 | R1(B,C,D,A,X[12],20,0x8d2a4c8aL); | 261 | R1(B,C,D,A,X(12),20,0x8d2a4c8aL); |
260 | /* Round 2 */ | 262 | /* Round 2 */ |
261 | R2(A,B,C,D,X[ 5], 4,0xfffa3942L); | 263 | R2(A,B,C,D,X( 5), 4,0xfffa3942L); |
262 | R2(D,A,B,C,X[ 8],11,0x8771f681L); | 264 | R2(D,A,B,C,X( 8),11,0x8771f681L); |
263 | R2(C,D,A,B,X[11],16,0x6d9d6122L); | 265 | R2(C,D,A,B,X(11),16,0x6d9d6122L); |
264 | R2(B,C,D,A,X[14],23,0xfde5380cL); | 266 | R2(B,C,D,A,X(14),23,0xfde5380cL); |
265 | R2(A,B,C,D,X[ 1], 4,0xa4beea44L); | 267 | R2(A,B,C,D,X( 1), 4,0xa4beea44L); |
266 | R2(D,A,B,C,X[ 4],11,0x4bdecfa9L); | 268 | R2(D,A,B,C,X( 4),11,0x4bdecfa9L); |
267 | R2(C,D,A,B,X[ 7],16,0xf6bb4b60L); | 269 | R2(C,D,A,B,X( 7),16,0xf6bb4b60L); |
268 | R2(B,C,D,A,X[10],23,0xbebfbc70L); | 270 | R2(B,C,D,A,X(10),23,0xbebfbc70L); |
269 | R2(A,B,C,D,X[13], 4,0x289b7ec6L); | 271 | R2(A,B,C,D,X(13), 4,0x289b7ec6L); |
270 | R2(D,A,B,C,X[ 0],11,0xeaa127faL); | 272 | R2(D,A,B,C,X( 0),11,0xeaa127faL); |
271 | R2(C,D,A,B,X[ 3],16,0xd4ef3085L); | 273 | R2(C,D,A,B,X( 3),16,0xd4ef3085L); |
272 | R2(B,C,D,A,X[ 6],23,0x04881d05L); | 274 | R2(B,C,D,A,X( 6),23,0x04881d05L); |
273 | R2(A,B,C,D,X[ 9], 4,0xd9d4d039L); | 275 | R2(A,B,C,D,X( 9), 4,0xd9d4d039L); |
274 | R2(D,A,B,C,X[12],11,0xe6db99e5L); | 276 | R2(D,A,B,C,X(12),11,0xe6db99e5L); |
275 | R2(C,D,A,B,X[15],16,0x1fa27cf8L); | 277 | R2(C,D,A,B,X(15),16,0x1fa27cf8L); |
276 | R2(B,C,D,A,X[ 2],23,0xc4ac5665L); | 278 | R2(B,C,D,A,X( 2),23,0xc4ac5665L); |
277 | /* Round 3 */ | 279 | /* Round 3 */ |
278 | R3(A,B,C,D,X[ 0], 6,0xf4292244L); | 280 | R3(A,B,C,D,X( 0), 6,0xf4292244L); |
279 | R3(D,A,B,C,X[ 7],10,0x432aff97L); | 281 | R3(D,A,B,C,X( 7),10,0x432aff97L); |
280 | R3(C,D,A,B,X[14],15,0xab9423a7L); | 282 | R3(C,D,A,B,X(14),15,0xab9423a7L); |
281 | R3(B,C,D,A,X[ 5],21,0xfc93a039L); | 283 | R3(B,C,D,A,X( 5),21,0xfc93a039L); |
282 | R3(A,B,C,D,X[12], 6,0x655b59c3L); | 284 | R3(A,B,C,D,X(12), 6,0x655b59c3L); |
283 | R3(D,A,B,C,X[ 3],10,0x8f0ccc92L); | 285 | R3(D,A,B,C,X( 3),10,0x8f0ccc92L); |
284 | R3(C,D,A,B,X[10],15,0xffeff47dL); | 286 | R3(C,D,A,B,X(10),15,0xffeff47dL); |
285 | R3(B,C,D,A,X[ 1],21,0x85845dd1L); | 287 | R3(B,C,D,A,X( 1),21,0x85845dd1L); |
286 | R3(A,B,C,D,X[ 8], 6,0x6fa87e4fL); | 288 | R3(A,B,C,D,X( 8), 6,0x6fa87e4fL); |
287 | R3(D,A,B,C,X[15],10,0xfe2ce6e0L); | 289 | R3(D,A,B,C,X(15),10,0xfe2ce6e0L); |
288 | R3(C,D,A,B,X[ 6],15,0xa3014314L); | 290 | R3(C,D,A,B,X( 6),15,0xa3014314L); |
289 | R3(B,C,D,A,X[13],21,0x4e0811a1L); | 291 | R3(B,C,D,A,X(13),21,0x4e0811a1L); |
290 | R3(A,B,C,D,X[ 4], 6,0xf7537e82L); | 292 | R3(A,B,C,D,X( 4), 6,0xf7537e82L); |
291 | R3(D,A,B,C,X[11],10,0xbd3af235L); | 293 | R3(D,A,B,C,X(11),10,0xbd3af235L); |
292 | R3(C,D,A,B,X[ 2],15,0x2ad7d2bbL); | 294 | R3(C,D,A,B,X( 2),15,0x2ad7d2bbL); |
293 | R3(B,C,D,A,X[ 9],21,0xeb86d391L); | 295 | R3(B,C,D,A,X( 9),21,0xeb86d391L); |
294 | 296 | ||
295 | A = c->A += A; | 297 | A = c->A += A; |
296 | B = c->B += B; | 298 | B = c->B += B; |
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 @@ | |||
77 | void md5_block_host_order (MD5_CTX *c, const void *p,int num); | 77 | void md5_block_host_order (MD5_CTX *c, const void *p,int num); |
78 | void md5_block_data_order (MD5_CTX *c, const void *p,int num); | 78 | void 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)) |
diff --git a/src/lib/libcrypto/md5/md5_one.c b/src/lib/libcrypto/md5/md5_one.c index 4b10e7f940..b89dec850d 100644 --- a/src/lib/libcrypto/md5/md5_one.c +++ b/src/lib/libcrypto/md5/md5_one.c | |||
@@ -64,7 +64,7 @@ | |||
64 | #include <openssl/ebcdic.h> | 64 | #include <openssl/ebcdic.h> |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | unsigned char *MD5(unsigned char *d, unsigned long n, unsigned char *md) | 67 | unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md) |
68 | { | 68 | { |
69 | MD5_CTX c; | 69 | MD5_CTX c; |
70 | static unsigned char m[MD5_DIGEST_LENGTH]; | 70 | static unsigned char m[MD5_DIGEST_LENGTH]; |
diff --git a/src/lib/libcrypto/md5/md5test.c b/src/lib/libcrypto/md5/md5test.c index a192a62bb3..6bd8656302 100644 --- a/src/lib/libcrypto/md5/md5test.c +++ b/src/lib/libcrypto/md5/md5test.c | |||
@@ -69,7 +69,7 @@ int main(int argc, char *argv[]) | |||
69 | #else | 69 | #else |
70 | #include <openssl/md5.h> | 70 | #include <openssl/md5.h> |
71 | 71 | ||
72 | char *test[]={ | 72 | static char *test[]={ |
73 | "", | 73 | "", |
74 | "a", | 74 | "a", |
75 | "abc", | 75 | "abc", |
@@ -80,7 +80,7 @@ char *test[]={ | |||
80 | NULL, | 80 | NULL, |
81 | }; | 81 | }; |
82 | 82 | ||
83 | char *ret[]={ | 83 | static char *ret[]={ |
84 | "d41d8cd98f00b204e9800998ecf8427e", | 84 | "d41d8cd98f00b204e9800998ecf8427e", |
85 | "0cc175b9c0f1b6a831c399e269772661", | 85 | "0cc175b9c0f1b6a831c399e269772661", |
86 | "900150983cd24fb0d6963f7d28e17f72", | 86 | "900150983cd24fb0d6963f7d28e17f72", |