From eb3e7d7ffe444652fe6f90808f95e08bc99cf5ae Mon Sep 17 00:00:00 2001 From: miod <> Date: Wed, 9 Jul 2014 16:06:14 +0000 Subject: 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 --- src/lib/libcrypto/bn/bn_nist.c | 4 +- src/lib/libcrypto/des/cfb_enc.c | 12 ++--- src/lib/libcrypto/modes/ctr128.c | 4 +- src/lib/libcrypto/modes/gcm128.c | 64 +++++++++++++-------------- src/lib/libcrypto/modes/xts128.c | 6 +-- src/lib/libcrypto/rc4/rc4_enc.c | 4 +- src/lib/libcrypto/sha/sha256.c | 4 +- src/lib/libcrypto/sha/sha512.c | 8 ++-- src/lib/libcrypto/sha/sha_locl.h | 4 +- src/lib/libcrypto/whrlpool/wp_block.c | 6 +-- src/lib/libssl/d1_pkt.c | 4 +- src/lib/libssl/src/crypto/bn/bn_nist.c | 4 +- src/lib/libssl/src/crypto/des/cfb_enc.c | 12 ++--- src/lib/libssl/src/crypto/modes/ctr128.c | 4 +- src/lib/libssl/src/crypto/modes/gcm128.c | 64 +++++++++++++-------------- src/lib/libssl/src/crypto/modes/xts128.c | 6 +-- src/lib/libssl/src/crypto/rc4/rc4_enc.c | 4 +- src/lib/libssl/src/crypto/sha/sha256.c | 4 +- src/lib/libssl/src/crypto/sha/sha512.c | 8 ++-- src/lib/libssl/src/crypto/sha/sha_locl.h | 4 +- src/lib/libssl/src/crypto/whrlpool/wp_block.c | 6 +-- src/lib/libssl/src/ssl/d1_pkt.c | 4 +- 22 files changed, 120 insertions(+), 120 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/bn/bn_nist.c b/src/lib/libcrypto/bn/bn_nist.c index a637d1d4e1..4ddb3c2a86 100644 --- a/src/lib/libcrypto/bn/bn_nist.c +++ b/src/lib/libcrypto/bn/bn_nist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_nist.c,v 1.11 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_nist.c,v 1.12 2014/07/09 16:06:13 miod Exp $ */ /* * Written by Nils Larsch for the OpenSSL project */ @@ -387,7 +387,7 @@ static void nist_cp_bn(BN_ULONG *dst, const BN_ULONG *src, int top) :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l))) #define bn_32_set_0(to, n) (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0)); #define bn_cp_32(to,n,from,m) ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n) -# if _BYTE_ORDER == _LITTLE_ENDIAN +# if BYTE_ORDER == LITTLE_ENDIAN # if defined(_LP64) # define NIST_INT64 long # else diff --git a/src/lib/libcrypto/des/cfb_enc.c b/src/lib/libcrypto/des/cfb_enc.c index 94ef35878f..b8c510067c 100644 --- a/src/lib/libcrypto/des/cfb_enc.c +++ b/src/lib/libcrypto/des/cfb_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfb_enc.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: cfb_enc.c,v 1.11 2014/07/09 16:06:13 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -77,7 +77,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, register int num=numbits/8,n=(numbits+7)/8,i,rem=numbits%8; DES_LONG ti[2]; unsigned char *iv; -#if _BYTE_ORDER != _LITTLE_ENDIAN +#if BYTE_ORDER != LITTLE_ENDIAN unsigned char ovec[16]; #else unsigned int sh[4]; @@ -115,7 +115,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, { v0=d0; v1=d1; } else { -#if _BYTE_ORDER != _LITTLE_ENDIAN +#if BYTE_ORDER != LITTLE_ENDIAN iv=&ovec[0]; l2c(v0,iv); l2c(v1,iv); @@ -130,7 +130,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, for(i=0 ; i < 8 ; ++i) ovec[i]=ovec[i+num]<>(8-rem); -#if _BYTE_ORDER == _LITTLE_ENDIAN +#if BYTE_ORDER == LITTLE_ENDIAN v0=sh[0], v1=sh[1]; #else iv=&ovec[0]; @@ -158,7 +158,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, { v0=d0; v1=d1; } else { -#if _BYTE_ORDER != _LITTLE_ENDIAN +#if BYTE_ORDER != LITTLE_ENDIAN iv=&ovec[0]; l2c(v0,iv); l2c(v1,iv); @@ -173,7 +173,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, for(i=0 ; i < 8 ; ++i) ovec[i]=ovec[i+num]<>(8-rem); -#if _BYTE_ORDER == _LITTLE_ENDIAN +#if BYTE_ORDER == LITTLE_ENDIAN v0=sh[0], v1=sh[1]; #else iv=&ovec[0]; diff --git a/src/lib/libcrypto/modes/ctr128.c b/src/lib/libcrypto/modes/ctr128.c index d08437214c..99d12b5503 100644 --- a/src/lib/libcrypto/modes/ctr128.c +++ b/src/lib/libcrypto/modes/ctr128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ctr128.c,v 1.4 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: ctr128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ /* ==================================================================== * Copyright (c) 2008 The OpenSSL Project. All rights reserved. * @@ -83,7 +83,7 @@ ctr128_inc_aligned(unsigned char *counter) { size_t *data,c,n; - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { ctr128_inc(counter); return; } diff --git a/src/lib/libcrypto/modes/gcm128.c b/src/lib/libcrypto/modes/gcm128.c index def8cca496..5b600517be 100644 --- a/src/lib/libcrypto/modes/gcm128.c +++ b/src/lib/libcrypto/modes/gcm128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gcm128.c,v 1.9 2014/06/27 06:07:35 deraadt Exp $ */ +/* $OpenBSD: gcm128.c,v 1.10 2014/07/09 16:06:13 miod Exp $ */ /* ==================================================================== * Copyright (c) 2010 The OpenSSL Project. All rights reserved. * @@ -231,7 +231,7 @@ static void gcm_gmult_8bit(u64 Xi[2], const u128 Htable[256]) Z.hi ^= (u64)rem_8bit[rem]<<32; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 Xi[0] = BSWAP8(Z.hi); Xi[1] = BSWAP8(Z.lo); @@ -308,7 +308,7 @@ static void gcm_init_4bit(u128 Htable[16], u64 H[2]) { int j; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) for (j=0;j<16;++j) { V = Htable[j]; Htable[j].hi = V.lo; @@ -374,7 +374,7 @@ static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16]) Z.lo ^= Htable[nlo].lo; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 Xi[0] = BSWAP8(Z.hi); Xi[1] = BSWAP8(Z.lo); @@ -543,7 +543,7 @@ static void gcm_ghash_4bit(u64 Xi[2],const u128 Htable[16], Z.hi ^= ((u64)rem_8bit[rem<<4])<<48; #endif - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 Xi[0] = BSWAP8(Z.hi); Xi[1] = BSWAP8(Z.lo); @@ -590,7 +590,7 @@ static void gcm_gmult_1bit(u64 Xi[2],const u64 H[2]) V.lo = H[1]; for (j=0; j<16/sizeof(long); ++j) { - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { if (sizeof(long)==8) { #ifdef BSWAP8 X = (long)(BSWAP8(xi[j])); @@ -616,7 +616,7 @@ static void gcm_gmult_1bit(u64 Xi[2],const u64 H[2]) } } - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 Xi[0] = BSWAP8(Z.hi); Xi[1] = BSWAP8(Z.lo); @@ -687,7 +687,7 @@ void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx,void *key,block128_f block) (*block)(ctx->H.c,ctx->H.c,key); - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { /* H is stored in host byte order */ #ifdef BSWAP8 ctx->H.u[0] = BSWAP8(ctx->H.u[0]); @@ -783,7 +783,7 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx,const unsigned char *iv,size_t len) GCM_MUL(ctx,Yi); } len0 <<= 3; - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 ctx->Yi.u[1] ^= BSWAP8(len0); #else @@ -802,7 +802,7 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx,const unsigned char *iv,size_t len) GCM_MUL(ctx,Yi); - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctr = BSWAP4(ctx->Yi.d[3]); #else @@ -814,7 +814,7 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx,const unsigned char *iv,size_t len) (*ctx->block)(ctx->Yi.c,ctx->EK0.c,ctx->key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -912,7 +912,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, ctx->ares = 0; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctr = BSWAP4(ctx->Yi.d[3]); #else @@ -950,7 +950,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -976,7 +976,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -999,7 +999,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1019,7 +1019,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, if (len) { (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1041,7 +1041,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, if (n==0) { (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1088,7 +1088,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, ctx->ares = 0; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctr = BSWAP4(ctx->Yi.d[3]); #else @@ -1129,7 +1129,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1153,7 +1153,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1175,7 +1175,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1197,7 +1197,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, if (len) { (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1222,7 +1222,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, if (n==0) { (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1270,7 +1270,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, ctx->ares = 0; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctr = BSWAP4(ctx->Yi.d[3]); #else @@ -1296,7 +1296,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, while (len>=GHASH_CHUNK) { (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); ctr += GHASH_CHUNK/16; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1315,7 +1315,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, (*stream)(in,out,j,key,ctx->Yi.c); ctr += (unsigned int)j; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1339,7 +1339,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, if (len) { (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1384,7 +1384,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, ctx->ares = 0; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctr = BSWAP4(ctx->Yi.d[3]); #else @@ -1413,7 +1413,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, GHASH(ctx,in,GHASH_CHUNK); (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); ctr += GHASH_CHUNK/16; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1443,7 +1443,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, #endif (*stream)(in,out,j,key,ctx->Yi.c); ctr += (unsigned int)j; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1458,7 +1458,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, if (len) { (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1490,7 +1490,7 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag, if (ctx->mres || ctx->ares) GCM_MUL(ctx,Xi); - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 alen = BSWAP8(alen); clen = BSWAP8(clen); diff --git a/src/lib/libcrypto/modes/xts128.c b/src/lib/libcrypto/modes/xts128.c index 177bde03fa..e6a0fbb0fa 100644 --- a/src/lib/libcrypto/modes/xts128.c +++ b/src/lib/libcrypto/modes/xts128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xts128.c,v 1.4 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: xts128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ /* ==================================================================== * Copyright (c) 2011 The OpenSSL Project. All rights reserved. * @@ -99,7 +99,7 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], if (len==0) return 0; - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { unsigned int carry,res; res = 0x87&(((int)tweak.d[3])>>31); @@ -135,7 +135,7 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], else { union { u64 u[2]; u8 c[16]; } tweak1; - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { unsigned int carry,res; res = 0x87&(((int)tweak.d[3])>>31); diff --git a/src/lib/libcrypto/rc4/rc4_enc.c b/src/lib/libcrypto/rc4/rc4_enc.c index d61072c5ec..79051b3e2a 100644 --- a/src/lib/libcrypto/rc4/rc4_enc.c +++ b/src/lib/libcrypto/rc4/rc4_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rc4_enc.c,v 1.11 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: rc4_enc.c,v 1.12 2014/07/09 16:06:13 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -150,7 +150,7 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, * * */ - if (_BYTE_ORDER != _LITTLE_ENDIAN) + if (BYTE_ORDER != LITTLE_ENDIAN) { /* BIG-ENDIAN CASE */ # define BESHFT(c) (((sizeof(RC4_CHUNK)-(c)-1)*8)&(sizeof(RC4_CHUNK)*8-1)) for (;len&(0-sizeof(RC4_CHUNK));len-=sizeof(RC4_CHUNK)) 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 @@ -/* $OpenBSD: sha256.c,v 1.5 2014/07/09 11:10:51 bcook Exp $ */ +/* $OpenBSD: sha256.c,v 1.6 2014/07/09 16:06:13 miod Exp $ */ /* ==================================================================== * Copyright (c) 2004 The OpenSSL Project. All rights reserved * 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 a = ctx->h[0]; b = ctx->h[1]; c = ctx->h[2]; d = ctx->h[3]; e = ctx->h[4]; f = ctx->h[5]; g = ctx->h[6]; h = ctx->h[7]; - if (_BYTE_ORDER != _LITTLE_ENDIAN && + if (BYTE_ORDER != LITTLE_ENDIAN && sizeof(SHA_LONG)==4 && ((size_t)in%4)==0) { 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 @@ -/* $OpenBSD: sha512.c,v 1.10 2014/07/09 11:10:51 bcook Exp $ */ +/* $OpenBSD: sha512.c,v 1.11 2014/07/09 16:06:13 miod Exp $ */ /* ==================================================================== * Copyright (c) 2004 The OpenSSL Project. All rights reserved * according to the OpenSSL license [found in ../../LICENSE]. @@ -104,7 +104,7 @@ int SHA512_Final (unsigned char *md, SHA512_CTX *c) sha512_block_data_order (c,p,1); memset (p+n,0,sizeof(c->u)-16-n); -#if _BYTE_ORDER == _BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN c->u.d[SHA_LBLOCK-2] = c->Nh; c->u.d[SHA_LBLOCK-1] = c->Nl; #else @@ -431,7 +431,7 @@ static void sha512_block_data_order (SHA512_CTX *ctx, const void *in, size_t num for (i=0;i<16;i++) { -#if _BYTE_ORDER == _BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN T1 = X[i] = W[i]; #else 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 a = ctx->h[0]; b = ctx->h[1]; c = ctx->h[2]; d = ctx->h[3]; e = ctx->h[4]; f = ctx->h[5]; g = ctx->h[6]; h = ctx->h[7]; -#if _BYTE_ORDER == _BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN T1 = X[0] = W[0]; ROUND_00_15(0,a,b,c,d,e,f,g,h); T1 = X[1] = W[1]; ROUND_00_15(1,h,a,b,c,d,e,f,g); 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 @@ -/* $OpenBSD: sha_locl.h,v 1.16 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: sha_locl.h,v 1.17 2014/07/09 16:06:13 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -223,7 +223,7 @@ static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num) for (;;) { - if (_BYTE_ORDER != _LITTLE_ENDIAN && + if (BYTE_ORDER != LITTLE_ENDIAN && sizeof(SHA_LONG)==4 && ((size_t)p%4)==0) { const SHA_LONG *W=(const SHA_LONG *)data; diff --git a/src/lib/libcrypto/whrlpool/wp_block.c b/src/lib/libcrypto/whrlpool/wp_block.c index 92d834e289..d357e529ca 100644 --- a/src/lib/libcrypto/whrlpool/wp_block.c +++ b/src/lib/libcrypto/whrlpool/wp_block.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wp_block.c,v 1.8 2014/07/08 16:15:20 miod Exp $ */ +/* $OpenBSD: wp_block.c,v 1.9 2014/07/09 16:06:13 miod Exp $ */ /** * The Whirlpool hashing function. * @@ -76,7 +76,7 @@ typedef unsigned long long u64; # define ROTATE(a,n) ({ u64 ret; asm ("rolq %1,%0" \ : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; }) # elif defined(__ia64) || defined(__ia64__) -# if _BYTE_ORDER == _LITTLE_ENDIAN +# if BYTE_ORDER == LITTLE_ENDIAN # define ROTATE(a,n) ({ u64 ret; asm ("shrp %0=%1,%1,%2" \ : "=r"(ret) : "r"(a),"M"(64-(n))); ret; }) # else @@ -88,7 +88,7 @@ typedef unsigned long long u64; #if defined(OPENSSL_SMALL_FOOTPRINT) # if !defined(ROTATE) -# if _BYTE_ORDER == _LITTLE_ENDIAN /* little-endians have to rotate left */ +# if BYTE_ORDER == LITTLE_ENDIAN /* little-endians have to rotate left */ # define ROTATE(i,n) ((i)<<(n) ^ (i)>>(64-n)) # else /* big-endians have to rotate right */ # define ROTATE(i,n) ((i)>>(n) ^ (i)<<(64-n)) diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index d75f56beb6..56e6939aed 100644 --- a/src/lib/libssl/d1_pkt.c +++ b/src/lib/libssl/d1_pkt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_pkt.c,v 1.30 2014/06/19 21:29:51 tedu Exp $ */ +/* $OpenBSD: d1_pkt.c,v 1.31 2014/07/09 16:06:14 miod Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -133,7 +133,7 @@ satsub64be(const unsigned char *v1, const unsigned char *v2) do { long l; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) break; /* not reached on little-endians */ /* following test is redundant, because input is diff --git a/src/lib/libssl/src/crypto/bn/bn_nist.c b/src/lib/libssl/src/crypto/bn/bn_nist.c index a637d1d4e1..4ddb3c2a86 100644 --- a/src/lib/libssl/src/crypto/bn/bn_nist.c +++ b/src/lib/libssl/src/crypto/bn/bn_nist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_nist.c,v 1.11 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: bn_nist.c,v 1.12 2014/07/09 16:06:13 miod Exp $ */ /* * Written by Nils Larsch for the OpenSSL project */ @@ -387,7 +387,7 @@ static void nist_cp_bn(BN_ULONG *dst, const BN_ULONG *src, int top) :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l))) #define bn_32_set_0(to, n) (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0)); #define bn_cp_32(to,n,from,m) ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n) -# if _BYTE_ORDER == _LITTLE_ENDIAN +# if BYTE_ORDER == LITTLE_ENDIAN # if defined(_LP64) # define NIST_INT64 long # else diff --git a/src/lib/libssl/src/crypto/des/cfb_enc.c b/src/lib/libssl/src/crypto/des/cfb_enc.c index 94ef35878f..b8c510067c 100644 --- a/src/lib/libssl/src/crypto/des/cfb_enc.c +++ b/src/lib/libssl/src/crypto/des/cfb_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfb_enc.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: cfb_enc.c,v 1.11 2014/07/09 16:06:13 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -77,7 +77,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, register int num=numbits/8,n=(numbits+7)/8,i,rem=numbits%8; DES_LONG ti[2]; unsigned char *iv; -#if _BYTE_ORDER != _LITTLE_ENDIAN +#if BYTE_ORDER != LITTLE_ENDIAN unsigned char ovec[16]; #else unsigned int sh[4]; @@ -115,7 +115,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, { v0=d0; v1=d1; } else { -#if _BYTE_ORDER != _LITTLE_ENDIAN +#if BYTE_ORDER != LITTLE_ENDIAN iv=&ovec[0]; l2c(v0,iv); l2c(v1,iv); @@ -130,7 +130,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, for(i=0 ; i < 8 ; ++i) ovec[i]=ovec[i+num]<>(8-rem); -#if _BYTE_ORDER == _LITTLE_ENDIAN +#if BYTE_ORDER == LITTLE_ENDIAN v0=sh[0], v1=sh[1]; #else iv=&ovec[0]; @@ -158,7 +158,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, { v0=d0; v1=d1; } else { -#if _BYTE_ORDER != _LITTLE_ENDIAN +#if BYTE_ORDER != LITTLE_ENDIAN iv=&ovec[0]; l2c(v0,iv); l2c(v1,iv); @@ -173,7 +173,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, for(i=0 ; i < 8 ; ++i) ovec[i]=ovec[i+num]<>(8-rem); -#if _BYTE_ORDER == _LITTLE_ENDIAN +#if BYTE_ORDER == LITTLE_ENDIAN v0=sh[0], v1=sh[1]; #else iv=&ovec[0]; diff --git a/src/lib/libssl/src/crypto/modes/ctr128.c b/src/lib/libssl/src/crypto/modes/ctr128.c index d08437214c..99d12b5503 100644 --- a/src/lib/libssl/src/crypto/modes/ctr128.c +++ b/src/lib/libssl/src/crypto/modes/ctr128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ctr128.c,v 1.4 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: ctr128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ /* ==================================================================== * Copyright (c) 2008 The OpenSSL Project. All rights reserved. * @@ -83,7 +83,7 @@ ctr128_inc_aligned(unsigned char *counter) { size_t *data,c,n; - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { ctr128_inc(counter); return; } diff --git a/src/lib/libssl/src/crypto/modes/gcm128.c b/src/lib/libssl/src/crypto/modes/gcm128.c index def8cca496..5b600517be 100644 --- a/src/lib/libssl/src/crypto/modes/gcm128.c +++ b/src/lib/libssl/src/crypto/modes/gcm128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gcm128.c,v 1.9 2014/06/27 06:07:35 deraadt Exp $ */ +/* $OpenBSD: gcm128.c,v 1.10 2014/07/09 16:06:13 miod Exp $ */ /* ==================================================================== * Copyright (c) 2010 The OpenSSL Project. All rights reserved. * @@ -231,7 +231,7 @@ static void gcm_gmult_8bit(u64 Xi[2], const u128 Htable[256]) Z.hi ^= (u64)rem_8bit[rem]<<32; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 Xi[0] = BSWAP8(Z.hi); Xi[1] = BSWAP8(Z.lo); @@ -308,7 +308,7 @@ static void gcm_init_4bit(u128 Htable[16], u64 H[2]) { int j; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) for (j=0;j<16;++j) { V = Htable[j]; Htable[j].hi = V.lo; @@ -374,7 +374,7 @@ static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16]) Z.lo ^= Htable[nlo].lo; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 Xi[0] = BSWAP8(Z.hi); Xi[1] = BSWAP8(Z.lo); @@ -543,7 +543,7 @@ static void gcm_ghash_4bit(u64 Xi[2],const u128 Htable[16], Z.hi ^= ((u64)rem_8bit[rem<<4])<<48; #endif - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 Xi[0] = BSWAP8(Z.hi); Xi[1] = BSWAP8(Z.lo); @@ -590,7 +590,7 @@ static void gcm_gmult_1bit(u64 Xi[2],const u64 H[2]) V.lo = H[1]; for (j=0; j<16/sizeof(long); ++j) { - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { if (sizeof(long)==8) { #ifdef BSWAP8 X = (long)(BSWAP8(xi[j])); @@ -616,7 +616,7 @@ static void gcm_gmult_1bit(u64 Xi[2],const u64 H[2]) } } - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 Xi[0] = BSWAP8(Z.hi); Xi[1] = BSWAP8(Z.lo); @@ -687,7 +687,7 @@ void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx,void *key,block128_f block) (*block)(ctx->H.c,ctx->H.c,key); - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { /* H is stored in host byte order */ #ifdef BSWAP8 ctx->H.u[0] = BSWAP8(ctx->H.u[0]); @@ -783,7 +783,7 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx,const unsigned char *iv,size_t len) GCM_MUL(ctx,Yi); } len0 <<= 3; - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 ctx->Yi.u[1] ^= BSWAP8(len0); #else @@ -802,7 +802,7 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx,const unsigned char *iv,size_t len) GCM_MUL(ctx,Yi); - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctr = BSWAP4(ctx->Yi.d[3]); #else @@ -814,7 +814,7 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx,const unsigned char *iv,size_t len) (*ctx->block)(ctx->Yi.c,ctx->EK0.c,ctx->key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -912,7 +912,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, ctx->ares = 0; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctr = BSWAP4(ctx->Yi.d[3]); #else @@ -950,7 +950,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -976,7 +976,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -999,7 +999,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1019,7 +1019,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, if (len) { (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1041,7 +1041,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, if (n==0) { (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1088,7 +1088,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, ctx->ares = 0; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctr = BSWAP4(ctx->Yi.d[3]); #else @@ -1129,7 +1129,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1153,7 +1153,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1175,7 +1175,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1197,7 +1197,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, if (len) { (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1222,7 +1222,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, if (n==0) { (*block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1270,7 +1270,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, ctx->ares = 0; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctr = BSWAP4(ctx->Yi.d[3]); #else @@ -1296,7 +1296,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, while (len>=GHASH_CHUNK) { (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); ctr += GHASH_CHUNK/16; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1315,7 +1315,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, (*stream)(in,out,j,key,ctx->Yi.c); ctr += (unsigned int)j; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1339,7 +1339,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, if (len) { (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1384,7 +1384,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, ctx->ares = 0; } - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctr = BSWAP4(ctx->Yi.d[3]); #else @@ -1413,7 +1413,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, GHASH(ctx,in,GHASH_CHUNK); (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); ctr += GHASH_CHUNK/16; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1443,7 +1443,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, #endif (*stream)(in,out,j,key,ctx->Yi.c); ctr += (unsigned int)j; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1458,7 +1458,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, if (len) { (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); ++ctr; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) #ifdef BSWAP4 ctx->Yi.d[3] = BSWAP4(ctr); #else @@ -1490,7 +1490,7 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag, if (ctx->mres || ctx->ares) GCM_MUL(ctx,Xi); - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { #ifdef BSWAP8 alen = BSWAP8(alen); clen = BSWAP8(clen); diff --git a/src/lib/libssl/src/crypto/modes/xts128.c b/src/lib/libssl/src/crypto/modes/xts128.c index 177bde03fa..e6a0fbb0fa 100644 --- a/src/lib/libssl/src/crypto/modes/xts128.c +++ b/src/lib/libssl/src/crypto/modes/xts128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xts128.c,v 1.4 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: xts128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ /* ==================================================================== * Copyright (c) 2011 The OpenSSL Project. All rights reserved. * @@ -99,7 +99,7 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], if (len==0) return 0; - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { unsigned int carry,res; res = 0x87&(((int)tweak.d[3])>>31); @@ -135,7 +135,7 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], else { union { u64 u[2]; u8 c[16]; } tweak1; - if (_BYTE_ORDER == _LITTLE_ENDIAN) { + if (BYTE_ORDER == LITTLE_ENDIAN) { unsigned int carry,res; res = 0x87&(((int)tweak.d[3])>>31); diff --git a/src/lib/libssl/src/crypto/rc4/rc4_enc.c b/src/lib/libssl/src/crypto/rc4/rc4_enc.c index d61072c5ec..79051b3e2a 100644 --- a/src/lib/libssl/src/crypto/rc4/rc4_enc.c +++ b/src/lib/libssl/src/crypto/rc4/rc4_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rc4_enc.c,v 1.11 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: rc4_enc.c,v 1.12 2014/07/09 16:06:13 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -150,7 +150,7 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, * * */ - if (_BYTE_ORDER != _LITTLE_ENDIAN) + if (BYTE_ORDER != LITTLE_ENDIAN) { /* BIG-ENDIAN CASE */ # define BESHFT(c) (((sizeof(RC4_CHUNK)-(c)-1)*8)&(sizeof(RC4_CHUNK)*8-1)) for (;len&(0-sizeof(RC4_CHUNK));len-=sizeof(RC4_CHUNK)) diff --git a/src/lib/libssl/src/crypto/sha/sha256.c b/src/lib/libssl/src/crypto/sha/sha256.c index b623893be4..6d7af561fc 100644 --- a/src/lib/libssl/src/crypto/sha/sha256.c +++ b/src/lib/libssl/src/crypto/sha/sha256.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha256.c,v 1.5 2014/07/09 11:10:51 bcook Exp $ */ +/* $OpenBSD: sha256.c,v 1.6 2014/07/09 16:06:13 miod Exp $ */ /* ==================================================================== * Copyright (c) 2004 The OpenSSL Project. All rights reserved * 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 a = ctx->h[0]; b = ctx->h[1]; c = ctx->h[2]; d = ctx->h[3]; e = ctx->h[4]; f = ctx->h[5]; g = ctx->h[6]; h = ctx->h[7]; - if (_BYTE_ORDER != _LITTLE_ENDIAN && + if (BYTE_ORDER != LITTLE_ENDIAN && sizeof(SHA_LONG)==4 && ((size_t)in%4)==0) { const SHA_LONG *W=(const SHA_LONG *)data; diff --git a/src/lib/libssl/src/crypto/sha/sha512.c b/src/lib/libssl/src/crypto/sha/sha512.c index 08b1564363..01ec6a6cde 100644 --- a/src/lib/libssl/src/crypto/sha/sha512.c +++ b/src/lib/libssl/src/crypto/sha/sha512.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha512.c,v 1.10 2014/07/09 11:10:51 bcook Exp $ */ +/* $OpenBSD: sha512.c,v 1.11 2014/07/09 16:06:13 miod Exp $ */ /* ==================================================================== * Copyright (c) 2004 The OpenSSL Project. All rights reserved * according to the OpenSSL license [found in ../../LICENSE]. @@ -104,7 +104,7 @@ int SHA512_Final (unsigned char *md, SHA512_CTX *c) sha512_block_data_order (c,p,1); memset (p+n,0,sizeof(c->u)-16-n); -#if _BYTE_ORDER == _BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN c->u.d[SHA_LBLOCK-2] = c->Nh; c->u.d[SHA_LBLOCK-1] = c->Nl; #else @@ -431,7 +431,7 @@ static void sha512_block_data_order (SHA512_CTX *ctx, const void *in, size_t num for (i=0;i<16;i++) { -#if _BYTE_ORDER == _BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN T1 = X[i] = W[i]; #else 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 a = ctx->h[0]; b = ctx->h[1]; c = ctx->h[2]; d = ctx->h[3]; e = ctx->h[4]; f = ctx->h[5]; g = ctx->h[6]; h = ctx->h[7]; -#if _BYTE_ORDER == _BIG_ENDIAN +#if BYTE_ORDER == BIG_ENDIAN T1 = X[0] = W[0]; ROUND_00_15(0,a,b,c,d,e,f,g,h); T1 = X[1] = W[1]; ROUND_00_15(1,h,a,b,c,d,e,f,g); T1 = X[2] = W[2]; ROUND_00_15(2,g,h,a,b,c,d,e,f); diff --git a/src/lib/libssl/src/crypto/sha/sha_locl.h b/src/lib/libssl/src/crypto/sha/sha_locl.h index e03b6453cb..e19b7e521b 100644 --- a/src/lib/libssl/src/crypto/sha/sha_locl.h +++ b/src/lib/libssl/src/crypto/sha/sha_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sha_locl.h,v 1.16 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: sha_locl.h,v 1.17 2014/07/09 16:06:13 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -223,7 +223,7 @@ static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num) for (;;) { - if (_BYTE_ORDER != _LITTLE_ENDIAN && + if (BYTE_ORDER != LITTLE_ENDIAN && sizeof(SHA_LONG)==4 && ((size_t)p%4)==0) { const SHA_LONG *W=(const SHA_LONG *)data; diff --git a/src/lib/libssl/src/crypto/whrlpool/wp_block.c b/src/lib/libssl/src/crypto/whrlpool/wp_block.c index 92d834e289..d357e529ca 100644 --- a/src/lib/libssl/src/crypto/whrlpool/wp_block.c +++ b/src/lib/libssl/src/crypto/whrlpool/wp_block.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wp_block.c,v 1.8 2014/07/08 16:15:20 miod Exp $ */ +/* $OpenBSD: wp_block.c,v 1.9 2014/07/09 16:06:13 miod Exp $ */ /** * The Whirlpool hashing function. * @@ -76,7 +76,7 @@ typedef unsigned long long u64; # define ROTATE(a,n) ({ u64 ret; asm ("rolq %1,%0" \ : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; }) # elif defined(__ia64) || defined(__ia64__) -# if _BYTE_ORDER == _LITTLE_ENDIAN +# if BYTE_ORDER == LITTLE_ENDIAN # define ROTATE(a,n) ({ u64 ret; asm ("shrp %0=%1,%1,%2" \ : "=r"(ret) : "r"(a),"M"(64-(n))); ret; }) # else @@ -88,7 +88,7 @@ typedef unsigned long long u64; #if defined(OPENSSL_SMALL_FOOTPRINT) # if !defined(ROTATE) -# if _BYTE_ORDER == _LITTLE_ENDIAN /* little-endians have to rotate left */ +# if BYTE_ORDER == LITTLE_ENDIAN /* little-endians have to rotate left */ # define ROTATE(i,n) ((i)<<(n) ^ (i)>>(64-n)) # else /* big-endians have to rotate right */ # define ROTATE(i,n) ((i)>>(n) ^ (i)<<(64-n)) diff --git a/src/lib/libssl/src/ssl/d1_pkt.c b/src/lib/libssl/src/ssl/d1_pkt.c index d75f56beb6..56e6939aed 100644 --- a/src/lib/libssl/src/ssl/d1_pkt.c +++ b/src/lib/libssl/src/ssl/d1_pkt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_pkt.c,v 1.30 2014/06/19 21:29:51 tedu Exp $ */ +/* $OpenBSD: d1_pkt.c,v 1.31 2014/07/09 16:06:14 miod Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -133,7 +133,7 @@ satsub64be(const unsigned char *v1, const unsigned char *v2) do { long l; - if (_BYTE_ORDER == _LITTLE_ENDIAN) + if (BYTE_ORDER == LITTLE_ENDIAN) break; /* not reached on little-endians */ /* following test is redundant, because input is -- cgit v1.2.3-55-g6feb