diff options
Diffstat (limited to 'src/lib/libcrypto/sha')
-rw-r--r-- | src/lib/libcrypto/sha/sha256.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/sha/sha512.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/sha/sha_locl.h | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libcrypto/sha/sha256.c b/src/lib/libcrypto/sha/sha256.c index b623893be4..6d7af561fc 100644 --- a/src/lib/libcrypto/sha/sha256.c +++ b/src/lib/libcrypto/sha/sha256.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sha256.c,v 1.5 2014/07/09 11:10:51 bcook Exp $ */ | 1 | /* $OpenBSD: sha256.c,v 1.6 2014/07/09 16:06:13 miod Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved | 3 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved |
4 | * according to the OpenSSL license [found in ../../LICENSE]. | 4 | * according to the OpenSSL license [found in ../../LICENSE]. |
@@ -211,7 +211,7 @@ static void sha256_block_data_order (SHA256_CTX *ctx, const void *in, size_t num | |||
211 | a = ctx->h[0]; b = ctx->h[1]; c = ctx->h[2]; d = ctx->h[3]; | 211 | a = ctx->h[0]; b = ctx->h[1]; c = ctx->h[2]; d = ctx->h[3]; |
212 | e = ctx->h[4]; f = ctx->h[5]; g = ctx->h[6]; h = ctx->h[7]; | 212 | e = ctx->h[4]; f = ctx->h[5]; g = ctx->h[6]; h = ctx->h[7]; |
213 | 213 | ||
214 | if (_BYTE_ORDER != _LITTLE_ENDIAN && | 214 | if (BYTE_ORDER != LITTLE_ENDIAN && |
215 | sizeof(SHA_LONG)==4 && ((size_t)in%4)==0) | 215 | sizeof(SHA_LONG)==4 && ((size_t)in%4)==0) |
216 | { | 216 | { |
217 | const SHA_LONG *W=(const SHA_LONG *)data; | 217 | const SHA_LONG *W=(const SHA_LONG *)data; |
diff --git a/src/lib/libcrypto/sha/sha512.c b/src/lib/libcrypto/sha/sha512.c index 08b1564363..01ec6a6cde 100644 --- a/src/lib/libcrypto/sha/sha512.c +++ b/src/lib/libcrypto/sha/sha512.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sha512.c,v 1.10 2014/07/09 11:10:51 bcook Exp $ */ | 1 | /* $OpenBSD: sha512.c,v 1.11 2014/07/09 16:06:13 miod Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved | 3 | * Copyright (c) 2004 The OpenSSL Project. All rights reserved |
4 | * according to the OpenSSL license [found in ../../LICENSE]. | 4 | * according to the OpenSSL license [found in ../../LICENSE]. |
@@ -104,7 +104,7 @@ int SHA512_Final (unsigned char *md, SHA512_CTX *c) | |||
104 | sha512_block_data_order (c,p,1); | 104 | sha512_block_data_order (c,p,1); |
105 | 105 | ||
106 | memset (p+n,0,sizeof(c->u)-16-n); | 106 | memset (p+n,0,sizeof(c->u)-16-n); |
107 | #if _BYTE_ORDER == _BIG_ENDIAN | 107 | #if BYTE_ORDER == BIG_ENDIAN |
108 | c->u.d[SHA_LBLOCK-2] = c->Nh; | 108 | c->u.d[SHA_LBLOCK-2] = c->Nh; |
109 | c->u.d[SHA_LBLOCK-1] = c->Nl; | 109 | c->u.d[SHA_LBLOCK-1] = c->Nl; |
110 | #else | 110 | #else |
@@ -431,7 +431,7 @@ static void sha512_block_data_order (SHA512_CTX *ctx, const void *in, size_t num | |||
431 | 431 | ||
432 | for (i=0;i<16;i++) | 432 | for (i=0;i<16;i++) |
433 | { | 433 | { |
434 | #if _BYTE_ORDER == _BIG_ENDIAN | 434 | #if BYTE_ORDER == BIG_ENDIAN |
435 | T1 = X[i] = W[i]; | 435 | T1 = X[i] = W[i]; |
436 | #else | 436 | #else |
437 | T1 = X[i] = PULL64(W[i]); | 437 | T1 = X[i] = PULL64(W[i]); |
@@ -486,7 +486,7 @@ static void sha512_block_data_order (SHA512_CTX *ctx, const void *in, size_t num | |||
486 | a = ctx->h[0]; b = ctx->h[1]; c = ctx->h[2]; d = ctx->h[3]; | 486 | a = ctx->h[0]; b = ctx->h[1]; c = ctx->h[2]; d = ctx->h[3]; |
487 | e = ctx->h[4]; f = ctx->h[5]; g = ctx->h[6]; h = ctx->h[7]; | 487 | e = ctx->h[4]; f = ctx->h[5]; g = ctx->h[6]; h = ctx->h[7]; |
488 | 488 | ||
489 | #if _BYTE_ORDER == _BIG_ENDIAN | 489 | #if BYTE_ORDER == BIG_ENDIAN |
490 | T1 = X[0] = W[0]; ROUND_00_15(0,a,b,c,d,e,f,g,h); | 490 | T1 = X[0] = W[0]; ROUND_00_15(0,a,b,c,d,e,f,g,h); |
491 | T1 = X[1] = W[1]; ROUND_00_15(1,h,a,b,c,d,e,f,g); | 491 | T1 = X[1] = W[1]; ROUND_00_15(1,h,a,b,c,d,e,f,g); |
492 | T1 = X[2] = W[2]; ROUND_00_15(2,g,h,a,b,c,d,e,f); | 492 | T1 = X[2] = W[2]; ROUND_00_15(2,g,h,a,b,c,d,e,f); |
diff --git a/src/lib/libcrypto/sha/sha_locl.h b/src/lib/libcrypto/sha/sha_locl.h index e03b6453cb..e19b7e521b 100644 --- a/src/lib/libcrypto/sha/sha_locl.h +++ b/src/lib/libcrypto/sha/sha_locl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sha_locl.h,v 1.16 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: sha_locl.h,v 1.17 2014/07/09 16:06:13 miod Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -223,7 +223,7 @@ static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num) | |||
223 | for (;;) | 223 | for (;;) |
224 | { | 224 | { |
225 | 225 | ||
226 | if (_BYTE_ORDER != _LITTLE_ENDIAN && | 226 | if (BYTE_ORDER != LITTLE_ENDIAN && |
227 | sizeof(SHA_LONG)==4 && ((size_t)p%4)==0) | 227 | sizeof(SHA_LONG)==4 && ((size_t)p%4)==0) |
228 | { | 228 | { |
229 | const SHA_LONG *W=(const SHA_LONG *)data; | 229 | const SHA_LONG *W=(const SHA_LONG *)data; |