diff options
author | miod <> | 2014-07-09 16:06:14 +0000 |
---|---|---|
committer | miod <> | 2014-07-09 16:06:14 +0000 |
commit | eb3e7d7ffe444652fe6f90808f95e08bc99cf5ae (patch) | |
tree | 49de6ec1ff73debc360d8605d09d765a8e604a22 /src/lib/libcrypto/sha/sha512.c | |
parent | 241b6a38fd4cff90e8e18e7c8dd2e6371f86a8e9 (diff) | |
download | openbsd-eb3e7d7ffe444652fe6f90808f95e08bc99cf5ae.tar.gz openbsd-eb3e7d7ffe444652fe6f90808f95e08bc99cf5ae.tar.bz2 openbsd-eb3e7d7ffe444652fe6f90808f95e08bc99cf5ae.zip |
Remove leading underscore from _BYTE_ORDER and _{LITTLE,BIG}_ENDIAN, to be
more friendly to systems where the underscore flavours may be defined as empty.
Found the hard way be bcook@; joint brainstrom with bcook beck and guenther
Diffstat (limited to 'src/lib/libcrypto/sha/sha512.c')
-rw-r--r-- | src/lib/libcrypto/sha/sha512.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); |