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 | |
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')
22 files changed, 120 insertions, 120 deletions
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 @@ | |||
1 | /* $OpenBSD: bn_nist.c,v 1.11 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: bn_nist.c,v 1.12 2014/07/09 16:06:13 miod Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project | 3 | * Written by Nils Larsch for the OpenSSL project |
4 | */ | 4 | */ |
@@ -387,7 +387,7 @@ static void nist_cp_bn(BN_ULONG *dst, const BN_ULONG *src, int top) | |||
387 | :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l))) | 387 | :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l))) |
388 | #define bn_32_set_0(to, n) (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0)); | 388 | #define bn_32_set_0(to, n) (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0)); |
389 | #define bn_cp_32(to,n,from,m) ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n) | 389 | #define bn_cp_32(to,n,from,m) ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n) |
390 | # if _BYTE_ORDER == _LITTLE_ENDIAN | 390 | # if BYTE_ORDER == LITTLE_ENDIAN |
391 | # if defined(_LP64) | 391 | # if defined(_LP64) |
392 | # define NIST_INT64 long | 392 | # define NIST_INT64 long |
393 | # else | 393 | # 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 @@ | |||
1 | /* $OpenBSD: cfb_enc.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: cfb_enc.c,v 1.11 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 | * |
@@ -77,7 +77,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
77 | register int num=numbits/8,n=(numbits+7)/8,i,rem=numbits%8; | 77 | register int num=numbits/8,n=(numbits+7)/8,i,rem=numbits%8; |
78 | DES_LONG ti[2]; | 78 | DES_LONG ti[2]; |
79 | unsigned char *iv; | 79 | unsigned char *iv; |
80 | #if _BYTE_ORDER != _LITTLE_ENDIAN | 80 | #if BYTE_ORDER != LITTLE_ENDIAN |
81 | unsigned char ovec[16]; | 81 | unsigned char ovec[16]; |
82 | #else | 82 | #else |
83 | unsigned int sh[4]; | 83 | unsigned int sh[4]; |
@@ -115,7 +115,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
115 | { v0=d0; v1=d1; } | 115 | { v0=d0; v1=d1; } |
116 | else | 116 | else |
117 | { | 117 | { |
118 | #if _BYTE_ORDER != _LITTLE_ENDIAN | 118 | #if BYTE_ORDER != LITTLE_ENDIAN |
119 | iv=&ovec[0]; | 119 | iv=&ovec[0]; |
120 | l2c(v0,iv); | 120 | l2c(v0,iv); |
121 | l2c(v1,iv); | 121 | l2c(v1,iv); |
@@ -130,7 +130,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
130 | for(i=0 ; i < 8 ; ++i) | 130 | for(i=0 ; i < 8 ; ++i) |
131 | ovec[i]=ovec[i+num]<<rem | | 131 | ovec[i]=ovec[i+num]<<rem | |
132 | ovec[i+num+1]>>(8-rem); | 132 | ovec[i+num+1]>>(8-rem); |
133 | #if _BYTE_ORDER == _LITTLE_ENDIAN | 133 | #if BYTE_ORDER == LITTLE_ENDIAN |
134 | v0=sh[0], v1=sh[1]; | 134 | v0=sh[0], v1=sh[1]; |
135 | #else | 135 | #else |
136 | iv=&ovec[0]; | 136 | iv=&ovec[0]; |
@@ -158,7 +158,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
158 | { v0=d0; v1=d1; } | 158 | { v0=d0; v1=d1; } |
159 | else | 159 | else |
160 | { | 160 | { |
161 | #if _BYTE_ORDER != _LITTLE_ENDIAN | 161 | #if BYTE_ORDER != LITTLE_ENDIAN |
162 | iv=&ovec[0]; | 162 | iv=&ovec[0]; |
163 | l2c(v0,iv); | 163 | l2c(v0,iv); |
164 | l2c(v1,iv); | 164 | l2c(v1,iv); |
@@ -173,7 +173,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
173 | for(i=0 ; i < 8 ; ++i) | 173 | for(i=0 ; i < 8 ; ++i) |
174 | ovec[i]=ovec[i+num]<<rem | | 174 | ovec[i]=ovec[i+num]<<rem | |
175 | ovec[i+num+1]>>(8-rem); | 175 | ovec[i+num+1]>>(8-rem); |
176 | #if _BYTE_ORDER == _LITTLE_ENDIAN | 176 | #if BYTE_ORDER == LITTLE_ENDIAN |
177 | v0=sh[0], v1=sh[1]; | 177 | v0=sh[0], v1=sh[1]; |
178 | #else | 178 | #else |
179 | iv=&ovec[0]; | 179 | 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 @@ | |||
1 | /* $OpenBSD: ctr128.c,v 1.4 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: ctr128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2008 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2008 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -83,7 +83,7 @@ ctr128_inc_aligned(unsigned char *counter) | |||
83 | { | 83 | { |
84 | size_t *data,c,n; | 84 | size_t *data,c,n; |
85 | 85 | ||
86 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 86 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
87 | ctr128_inc(counter); | 87 | ctr128_inc(counter); |
88 | return; | 88 | return; |
89 | } | 89 | } |
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 @@ | |||
1 | /* $OpenBSD: gcm128.c,v 1.9 2014/06/27 06:07:35 deraadt Exp $ */ | 1 | /* $OpenBSD: gcm128.c,v 1.10 2014/07/09 16:06:13 miod Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -231,7 +231,7 @@ static void gcm_gmult_8bit(u64 Xi[2], const u128 Htable[256]) | |||
231 | Z.hi ^= (u64)rem_8bit[rem]<<32; | 231 | Z.hi ^= (u64)rem_8bit[rem]<<32; |
232 | } | 232 | } |
233 | 233 | ||
234 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 234 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
235 | #ifdef BSWAP8 | 235 | #ifdef BSWAP8 |
236 | Xi[0] = BSWAP8(Z.hi); | 236 | Xi[0] = BSWAP8(Z.hi); |
237 | Xi[1] = BSWAP8(Z.lo); | 237 | Xi[1] = BSWAP8(Z.lo); |
@@ -308,7 +308,7 @@ static void gcm_init_4bit(u128 Htable[16], u64 H[2]) | |||
308 | { | 308 | { |
309 | int j; | 309 | int j; |
310 | 310 | ||
311 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 311 | if (BYTE_ORDER == LITTLE_ENDIAN) |
312 | for (j=0;j<16;++j) { | 312 | for (j=0;j<16;++j) { |
313 | V = Htable[j]; | 313 | V = Htable[j]; |
314 | Htable[j].hi = V.lo; | 314 | Htable[j].hi = V.lo; |
@@ -374,7 +374,7 @@ static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16]) | |||
374 | Z.lo ^= Htable[nlo].lo; | 374 | Z.lo ^= Htable[nlo].lo; |
375 | } | 375 | } |
376 | 376 | ||
377 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 377 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
378 | #ifdef BSWAP8 | 378 | #ifdef BSWAP8 |
379 | Xi[0] = BSWAP8(Z.hi); | 379 | Xi[0] = BSWAP8(Z.hi); |
380 | Xi[1] = BSWAP8(Z.lo); | 380 | Xi[1] = BSWAP8(Z.lo); |
@@ -543,7 +543,7 @@ static void gcm_ghash_4bit(u64 Xi[2],const u128 Htable[16], | |||
543 | Z.hi ^= ((u64)rem_8bit[rem<<4])<<48; | 543 | Z.hi ^= ((u64)rem_8bit[rem<<4])<<48; |
544 | #endif | 544 | #endif |
545 | 545 | ||
546 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 546 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
547 | #ifdef BSWAP8 | 547 | #ifdef BSWAP8 |
548 | Xi[0] = BSWAP8(Z.hi); | 548 | Xi[0] = BSWAP8(Z.hi); |
549 | Xi[1] = BSWAP8(Z.lo); | 549 | Xi[1] = BSWAP8(Z.lo); |
@@ -590,7 +590,7 @@ static void gcm_gmult_1bit(u64 Xi[2],const u64 H[2]) | |||
590 | V.lo = H[1]; | 590 | V.lo = H[1]; |
591 | 591 | ||
592 | for (j=0; j<16/sizeof(long); ++j) { | 592 | for (j=0; j<16/sizeof(long); ++j) { |
593 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 593 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
594 | if (sizeof(long)==8) { | 594 | if (sizeof(long)==8) { |
595 | #ifdef BSWAP8 | 595 | #ifdef BSWAP8 |
596 | X = (long)(BSWAP8(xi[j])); | 596 | X = (long)(BSWAP8(xi[j])); |
@@ -616,7 +616,7 @@ static void gcm_gmult_1bit(u64 Xi[2],const u64 H[2]) | |||
616 | } | 616 | } |
617 | } | 617 | } |
618 | 618 | ||
619 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 619 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
620 | #ifdef BSWAP8 | 620 | #ifdef BSWAP8 |
621 | Xi[0] = BSWAP8(Z.hi); | 621 | Xi[0] = BSWAP8(Z.hi); |
622 | Xi[1] = BSWAP8(Z.lo); | 622 | Xi[1] = BSWAP8(Z.lo); |
@@ -687,7 +687,7 @@ void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx,void *key,block128_f block) | |||
687 | 687 | ||
688 | (*block)(ctx->H.c,ctx->H.c,key); | 688 | (*block)(ctx->H.c,ctx->H.c,key); |
689 | 689 | ||
690 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 690 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
691 | /* H is stored in host byte order */ | 691 | /* H is stored in host byte order */ |
692 | #ifdef BSWAP8 | 692 | #ifdef BSWAP8 |
693 | ctx->H.u[0] = BSWAP8(ctx->H.u[0]); | 693 | 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) | |||
783 | GCM_MUL(ctx,Yi); | 783 | GCM_MUL(ctx,Yi); |
784 | } | 784 | } |
785 | len0 <<= 3; | 785 | len0 <<= 3; |
786 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 786 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
787 | #ifdef BSWAP8 | 787 | #ifdef BSWAP8 |
788 | ctx->Yi.u[1] ^= BSWAP8(len0); | 788 | ctx->Yi.u[1] ^= BSWAP8(len0); |
789 | #else | 789 | #else |
@@ -802,7 +802,7 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx,const unsigned char *iv,size_t len) | |||
802 | 802 | ||
803 | GCM_MUL(ctx,Yi); | 803 | GCM_MUL(ctx,Yi); |
804 | 804 | ||
805 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 805 | if (BYTE_ORDER == LITTLE_ENDIAN) |
806 | #ifdef BSWAP4 | 806 | #ifdef BSWAP4 |
807 | ctr = BSWAP4(ctx->Yi.d[3]); | 807 | ctr = BSWAP4(ctx->Yi.d[3]); |
808 | #else | 808 | #else |
@@ -814,7 +814,7 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx,const unsigned char *iv,size_t len) | |||
814 | 814 | ||
815 | (*ctx->block)(ctx->Yi.c,ctx->EK0.c,ctx->key); | 815 | (*ctx->block)(ctx->Yi.c,ctx->EK0.c,ctx->key); |
816 | ++ctr; | 816 | ++ctr; |
817 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 817 | if (BYTE_ORDER == LITTLE_ENDIAN) |
818 | #ifdef BSWAP4 | 818 | #ifdef BSWAP4 |
819 | ctx->Yi.d[3] = BSWAP4(ctr); | 819 | ctx->Yi.d[3] = BSWAP4(ctr); |
820 | #else | 820 | #else |
@@ -912,7 +912,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
912 | ctx->ares = 0; | 912 | ctx->ares = 0; |
913 | } | 913 | } |
914 | 914 | ||
915 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 915 | if (BYTE_ORDER == LITTLE_ENDIAN) |
916 | #ifdef BSWAP4 | 916 | #ifdef BSWAP4 |
917 | ctr = BSWAP4(ctx->Yi.d[3]); | 917 | ctr = BSWAP4(ctx->Yi.d[3]); |
918 | #else | 918 | #else |
@@ -950,7 +950,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
950 | 950 | ||
951 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 951 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
952 | ++ctr; | 952 | ++ctr; |
953 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 953 | if (BYTE_ORDER == LITTLE_ENDIAN) |
954 | #ifdef BSWAP4 | 954 | #ifdef BSWAP4 |
955 | ctx->Yi.d[3] = BSWAP4(ctr); | 955 | ctx->Yi.d[3] = BSWAP4(ctr); |
956 | #else | 956 | #else |
@@ -976,7 +976,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
976 | 976 | ||
977 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 977 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
978 | ++ctr; | 978 | ++ctr; |
979 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 979 | if (BYTE_ORDER == LITTLE_ENDIAN) |
980 | #ifdef BSWAP4 | 980 | #ifdef BSWAP4 |
981 | ctx->Yi.d[3] = BSWAP4(ctr); | 981 | ctx->Yi.d[3] = BSWAP4(ctr); |
982 | #else | 982 | #else |
@@ -999,7 +999,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
999 | 999 | ||
1000 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1000 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1001 | ++ctr; | 1001 | ++ctr; |
1002 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1002 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1003 | #ifdef BSWAP4 | 1003 | #ifdef BSWAP4 |
1004 | ctx->Yi.d[3] = BSWAP4(ctr); | 1004 | ctx->Yi.d[3] = BSWAP4(ctr); |
1005 | #else | 1005 | #else |
@@ -1019,7 +1019,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
1019 | if (len) { | 1019 | if (len) { |
1020 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1020 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1021 | ++ctr; | 1021 | ++ctr; |
1022 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1022 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1023 | #ifdef BSWAP4 | 1023 | #ifdef BSWAP4 |
1024 | ctx->Yi.d[3] = BSWAP4(ctr); | 1024 | ctx->Yi.d[3] = BSWAP4(ctr); |
1025 | #else | 1025 | #else |
@@ -1041,7 +1041,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
1041 | if (n==0) { | 1041 | if (n==0) { |
1042 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1042 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1043 | ++ctr; | 1043 | ++ctr; |
1044 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1044 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1045 | #ifdef BSWAP4 | 1045 | #ifdef BSWAP4 |
1046 | ctx->Yi.d[3] = BSWAP4(ctr); | 1046 | ctx->Yi.d[3] = BSWAP4(ctr); |
1047 | #else | 1047 | #else |
@@ -1088,7 +1088,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1088 | ctx->ares = 0; | 1088 | ctx->ares = 0; |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1091 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1092 | #ifdef BSWAP4 | 1092 | #ifdef BSWAP4 |
1093 | ctr = BSWAP4(ctx->Yi.d[3]); | 1093 | ctr = BSWAP4(ctx->Yi.d[3]); |
1094 | #else | 1094 | #else |
@@ -1129,7 +1129,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1129 | 1129 | ||
1130 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1130 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1131 | ++ctr; | 1131 | ++ctr; |
1132 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1132 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1133 | #ifdef BSWAP4 | 1133 | #ifdef BSWAP4 |
1134 | ctx->Yi.d[3] = BSWAP4(ctr); | 1134 | ctx->Yi.d[3] = BSWAP4(ctr); |
1135 | #else | 1135 | #else |
@@ -1153,7 +1153,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1153 | 1153 | ||
1154 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1154 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1155 | ++ctr; | 1155 | ++ctr; |
1156 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1156 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1157 | #ifdef BSWAP4 | 1157 | #ifdef BSWAP4 |
1158 | ctx->Yi.d[3] = BSWAP4(ctr); | 1158 | ctx->Yi.d[3] = BSWAP4(ctr); |
1159 | #else | 1159 | #else |
@@ -1175,7 +1175,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1175 | 1175 | ||
1176 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1176 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1177 | ++ctr; | 1177 | ++ctr; |
1178 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1178 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1179 | #ifdef BSWAP4 | 1179 | #ifdef BSWAP4 |
1180 | ctx->Yi.d[3] = BSWAP4(ctr); | 1180 | ctx->Yi.d[3] = BSWAP4(ctr); |
1181 | #else | 1181 | #else |
@@ -1197,7 +1197,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1197 | if (len) { | 1197 | if (len) { |
1198 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1198 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1199 | ++ctr; | 1199 | ++ctr; |
1200 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1200 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1201 | #ifdef BSWAP4 | 1201 | #ifdef BSWAP4 |
1202 | ctx->Yi.d[3] = BSWAP4(ctr); | 1202 | ctx->Yi.d[3] = BSWAP4(ctr); |
1203 | #else | 1203 | #else |
@@ -1222,7 +1222,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1222 | if (n==0) { | 1222 | if (n==0) { |
1223 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1223 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1224 | ++ctr; | 1224 | ++ctr; |
1225 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1225 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1226 | #ifdef BSWAP4 | 1226 | #ifdef BSWAP4 |
1227 | ctx->Yi.d[3] = BSWAP4(ctr); | 1227 | ctx->Yi.d[3] = BSWAP4(ctr); |
1228 | #else | 1228 | #else |
@@ -1270,7 +1270,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1270 | ctx->ares = 0; | 1270 | ctx->ares = 0; |
1271 | } | 1271 | } |
1272 | 1272 | ||
1273 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1273 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1274 | #ifdef BSWAP4 | 1274 | #ifdef BSWAP4 |
1275 | ctr = BSWAP4(ctx->Yi.d[3]); | 1275 | ctr = BSWAP4(ctx->Yi.d[3]); |
1276 | #else | 1276 | #else |
@@ -1296,7 +1296,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1296 | while (len>=GHASH_CHUNK) { | 1296 | while (len>=GHASH_CHUNK) { |
1297 | (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); | 1297 | (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); |
1298 | ctr += GHASH_CHUNK/16; | 1298 | ctr += GHASH_CHUNK/16; |
1299 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1299 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1300 | #ifdef BSWAP4 | 1300 | #ifdef BSWAP4 |
1301 | ctx->Yi.d[3] = BSWAP4(ctr); | 1301 | ctx->Yi.d[3] = BSWAP4(ctr); |
1302 | #else | 1302 | #else |
@@ -1315,7 +1315,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1315 | 1315 | ||
1316 | (*stream)(in,out,j,key,ctx->Yi.c); | 1316 | (*stream)(in,out,j,key,ctx->Yi.c); |
1317 | ctr += (unsigned int)j; | 1317 | ctr += (unsigned int)j; |
1318 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1318 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1319 | #ifdef BSWAP4 | 1319 | #ifdef BSWAP4 |
1320 | ctx->Yi.d[3] = BSWAP4(ctr); | 1320 | ctx->Yi.d[3] = BSWAP4(ctr); |
1321 | #else | 1321 | #else |
@@ -1339,7 +1339,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1339 | if (len) { | 1339 | if (len) { |
1340 | (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); | 1340 | (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); |
1341 | ++ctr; | 1341 | ++ctr; |
1342 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1342 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1343 | #ifdef BSWAP4 | 1343 | #ifdef BSWAP4 |
1344 | ctx->Yi.d[3] = BSWAP4(ctr); | 1344 | ctx->Yi.d[3] = BSWAP4(ctr); |
1345 | #else | 1345 | #else |
@@ -1384,7 +1384,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1384 | ctx->ares = 0; | 1384 | ctx->ares = 0; |
1385 | } | 1385 | } |
1386 | 1386 | ||
1387 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1387 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1388 | #ifdef BSWAP4 | 1388 | #ifdef BSWAP4 |
1389 | ctr = BSWAP4(ctx->Yi.d[3]); | 1389 | ctr = BSWAP4(ctx->Yi.d[3]); |
1390 | #else | 1390 | #else |
@@ -1413,7 +1413,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1413 | GHASH(ctx,in,GHASH_CHUNK); | 1413 | GHASH(ctx,in,GHASH_CHUNK); |
1414 | (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); | 1414 | (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); |
1415 | ctr += GHASH_CHUNK/16; | 1415 | ctr += GHASH_CHUNK/16; |
1416 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1416 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1417 | #ifdef BSWAP4 | 1417 | #ifdef BSWAP4 |
1418 | ctx->Yi.d[3] = BSWAP4(ctr); | 1418 | ctx->Yi.d[3] = BSWAP4(ctr); |
1419 | #else | 1419 | #else |
@@ -1443,7 +1443,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1443 | #endif | 1443 | #endif |
1444 | (*stream)(in,out,j,key,ctx->Yi.c); | 1444 | (*stream)(in,out,j,key,ctx->Yi.c); |
1445 | ctr += (unsigned int)j; | 1445 | ctr += (unsigned int)j; |
1446 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1446 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1447 | #ifdef BSWAP4 | 1447 | #ifdef BSWAP4 |
1448 | ctx->Yi.d[3] = BSWAP4(ctr); | 1448 | ctx->Yi.d[3] = BSWAP4(ctr); |
1449 | #else | 1449 | #else |
@@ -1458,7 +1458,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1458 | if (len) { | 1458 | if (len) { |
1459 | (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); | 1459 | (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); |
1460 | ++ctr; | 1460 | ++ctr; |
1461 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1461 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1462 | #ifdef BSWAP4 | 1462 | #ifdef BSWAP4 |
1463 | ctx->Yi.d[3] = BSWAP4(ctr); | 1463 | ctx->Yi.d[3] = BSWAP4(ctr); |
1464 | #else | 1464 | #else |
@@ -1490,7 +1490,7 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag, | |||
1490 | if (ctx->mres || ctx->ares) | 1490 | if (ctx->mres || ctx->ares) |
1491 | GCM_MUL(ctx,Xi); | 1491 | GCM_MUL(ctx,Xi); |
1492 | 1492 | ||
1493 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 1493 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
1494 | #ifdef BSWAP8 | 1494 | #ifdef BSWAP8 |
1495 | alen = BSWAP8(alen); | 1495 | alen = BSWAP8(alen); |
1496 | clen = BSWAP8(clen); | 1496 | 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 @@ | |||
1 | /* $OpenBSD: xts128.c,v 1.4 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: xts128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2011 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -99,7 +99,7 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], | |||
99 | 99 | ||
100 | if (len==0) return 0; | 100 | if (len==0) return 0; |
101 | 101 | ||
102 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 102 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
103 | unsigned int carry,res; | 103 | unsigned int carry,res; |
104 | 104 | ||
105 | res = 0x87&(((int)tweak.d[3])>>31); | 105 | res = 0x87&(((int)tweak.d[3])>>31); |
@@ -135,7 +135,7 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], | |||
135 | else { | 135 | else { |
136 | union { u64 u[2]; u8 c[16]; } tweak1; | 136 | union { u64 u[2]; u8 c[16]; } tweak1; |
137 | 137 | ||
138 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 138 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
139 | unsigned int carry,res; | 139 | unsigned int carry,res; |
140 | 140 | ||
141 | res = 0x87&(((int)tweak.d[3])>>31); | 141 | 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 @@ | |||
1 | /* $OpenBSD: rc4_enc.c,v 1.11 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: rc4_enc.c,v 1.12 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 | * |
@@ -150,7 +150,7 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, | |||
150 | * | 150 | * |
151 | * <appro@fy.chalmers.se> | 151 | * <appro@fy.chalmers.se> |
152 | */ | 152 | */ |
153 | if (_BYTE_ORDER != _LITTLE_ENDIAN) | 153 | if (BYTE_ORDER != LITTLE_ENDIAN) |
154 | { /* BIG-ENDIAN CASE */ | 154 | { /* BIG-ENDIAN CASE */ |
155 | # define BESHFT(c) (((sizeof(RC4_CHUNK)-(c)-1)*8)&(sizeof(RC4_CHUNK)*8-1)) | 155 | # define BESHFT(c) (((sizeof(RC4_CHUNK)-(c)-1)*8)&(sizeof(RC4_CHUNK)*8-1)) |
156 | for (;len&(0-sizeof(RC4_CHUNK));len-=sizeof(RC4_CHUNK)) | 156 | 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 @@ | |||
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; |
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 @@ | |||
1 | /* $OpenBSD: wp_block.c,v 1.8 2014/07/08 16:15:20 miod Exp $ */ | 1 | /* $OpenBSD: wp_block.c,v 1.9 2014/07/09 16:06:13 miod Exp $ */ |
2 | /** | 2 | /** |
3 | * The Whirlpool hashing function. | 3 | * The Whirlpool hashing function. |
4 | * | 4 | * |
@@ -76,7 +76,7 @@ typedef unsigned long long u64; | |||
76 | # define ROTATE(a,n) ({ u64 ret; asm ("rolq %1,%0" \ | 76 | # define ROTATE(a,n) ({ u64 ret; asm ("rolq %1,%0" \ |
77 | : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; }) | 77 | : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; }) |
78 | # elif defined(__ia64) || defined(__ia64__) | 78 | # elif defined(__ia64) || defined(__ia64__) |
79 | # if _BYTE_ORDER == _LITTLE_ENDIAN | 79 | # if BYTE_ORDER == LITTLE_ENDIAN |
80 | # define ROTATE(a,n) ({ u64 ret; asm ("shrp %0=%1,%1,%2" \ | 80 | # define ROTATE(a,n) ({ u64 ret; asm ("shrp %0=%1,%1,%2" \ |
81 | : "=r"(ret) : "r"(a),"M"(64-(n))); ret; }) | 81 | : "=r"(ret) : "r"(a),"M"(64-(n))); ret; }) |
82 | # else | 82 | # else |
@@ -88,7 +88,7 @@ typedef unsigned long long u64; | |||
88 | 88 | ||
89 | #if defined(OPENSSL_SMALL_FOOTPRINT) | 89 | #if defined(OPENSSL_SMALL_FOOTPRINT) |
90 | # if !defined(ROTATE) | 90 | # if !defined(ROTATE) |
91 | # if _BYTE_ORDER == _LITTLE_ENDIAN /* little-endians have to rotate left */ | 91 | # if BYTE_ORDER == LITTLE_ENDIAN /* little-endians have to rotate left */ |
92 | # define ROTATE(i,n) ((i)<<(n) ^ (i)>>(64-n)) | 92 | # define ROTATE(i,n) ((i)<<(n) ^ (i)>>(64-n)) |
93 | # else /* big-endians have to rotate right */ | 93 | # else /* big-endians have to rotate right */ |
94 | # define ROTATE(i,n) ((i)>>(n) ^ (i)<<(64-n)) | 94 | # 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 @@ | |||
1 | /* $OpenBSD: d1_pkt.c,v 1.30 2014/06/19 21:29:51 tedu Exp $ */ | 1 | /* $OpenBSD: d1_pkt.c,v 1.31 2014/07/09 16:06:14 miod Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -133,7 +133,7 @@ satsub64be(const unsigned char *v1, const unsigned char *v2) | |||
133 | do { | 133 | do { |
134 | long l; | 134 | long l; |
135 | 135 | ||
136 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 136 | if (BYTE_ORDER == LITTLE_ENDIAN) |
137 | break; | 137 | break; |
138 | /* not reached on little-endians */ | 138 | /* not reached on little-endians */ |
139 | /* following test is redundant, because input is | 139 | /* 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 @@ | |||
1 | /* $OpenBSD: bn_nist.c,v 1.11 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: bn_nist.c,v 1.12 2014/07/09 16:06:13 miod Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project | 3 | * Written by Nils Larsch for the OpenSSL project |
4 | */ | 4 | */ |
@@ -387,7 +387,7 @@ static void nist_cp_bn(BN_ULONG *dst, const BN_ULONG *src, int top) | |||
387 | :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l))) | 387 | :(to[(n)/2] =((m)&1)?(from[(m)/2]>>32):(from[(m)/2]&BN_MASK2l))) |
388 | #define bn_32_set_0(to, n) (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0)); | 388 | #define bn_32_set_0(to, n) (((n)&1)?(to[(n)/2]&=BN_MASK2l):(to[(n)/2]=0)); |
389 | #define bn_cp_32(to,n,from,m) ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n) | 389 | #define bn_cp_32(to,n,from,m) ((m)>=0)?bn_cp_32_naked(to,n,from,m):bn_32_set_0(to,n) |
390 | # if _BYTE_ORDER == _LITTLE_ENDIAN | 390 | # if BYTE_ORDER == LITTLE_ENDIAN |
391 | # if defined(_LP64) | 391 | # if defined(_LP64) |
392 | # define NIST_INT64 long | 392 | # define NIST_INT64 long |
393 | # else | 393 | # 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 @@ | |||
1 | /* $OpenBSD: cfb_enc.c,v 1.10 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: cfb_enc.c,v 1.11 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 | * |
@@ -77,7 +77,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
77 | register int num=numbits/8,n=(numbits+7)/8,i,rem=numbits%8; | 77 | register int num=numbits/8,n=(numbits+7)/8,i,rem=numbits%8; |
78 | DES_LONG ti[2]; | 78 | DES_LONG ti[2]; |
79 | unsigned char *iv; | 79 | unsigned char *iv; |
80 | #if _BYTE_ORDER != _LITTLE_ENDIAN | 80 | #if BYTE_ORDER != LITTLE_ENDIAN |
81 | unsigned char ovec[16]; | 81 | unsigned char ovec[16]; |
82 | #else | 82 | #else |
83 | unsigned int sh[4]; | 83 | unsigned int sh[4]; |
@@ -115,7 +115,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
115 | { v0=d0; v1=d1; } | 115 | { v0=d0; v1=d1; } |
116 | else | 116 | else |
117 | { | 117 | { |
118 | #if _BYTE_ORDER != _LITTLE_ENDIAN | 118 | #if BYTE_ORDER != LITTLE_ENDIAN |
119 | iv=&ovec[0]; | 119 | iv=&ovec[0]; |
120 | l2c(v0,iv); | 120 | l2c(v0,iv); |
121 | l2c(v1,iv); | 121 | l2c(v1,iv); |
@@ -130,7 +130,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
130 | for(i=0 ; i < 8 ; ++i) | 130 | for(i=0 ; i < 8 ; ++i) |
131 | ovec[i]=ovec[i+num]<<rem | | 131 | ovec[i]=ovec[i+num]<<rem | |
132 | ovec[i+num+1]>>(8-rem); | 132 | ovec[i+num+1]>>(8-rem); |
133 | #if _BYTE_ORDER == _LITTLE_ENDIAN | 133 | #if BYTE_ORDER == LITTLE_ENDIAN |
134 | v0=sh[0], v1=sh[1]; | 134 | v0=sh[0], v1=sh[1]; |
135 | #else | 135 | #else |
136 | iv=&ovec[0]; | 136 | iv=&ovec[0]; |
@@ -158,7 +158,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
158 | { v0=d0; v1=d1; } | 158 | { v0=d0; v1=d1; } |
159 | else | 159 | else |
160 | { | 160 | { |
161 | #if _BYTE_ORDER != _LITTLE_ENDIAN | 161 | #if BYTE_ORDER != LITTLE_ENDIAN |
162 | iv=&ovec[0]; | 162 | iv=&ovec[0]; |
163 | l2c(v0,iv); | 163 | l2c(v0,iv); |
164 | l2c(v1,iv); | 164 | l2c(v1,iv); |
@@ -173,7 +173,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
173 | for(i=0 ; i < 8 ; ++i) | 173 | for(i=0 ; i < 8 ; ++i) |
174 | ovec[i]=ovec[i+num]<<rem | | 174 | ovec[i]=ovec[i+num]<<rem | |
175 | ovec[i+num+1]>>(8-rem); | 175 | ovec[i+num+1]>>(8-rem); |
176 | #if _BYTE_ORDER == _LITTLE_ENDIAN | 176 | #if BYTE_ORDER == LITTLE_ENDIAN |
177 | v0=sh[0], v1=sh[1]; | 177 | v0=sh[0], v1=sh[1]; |
178 | #else | 178 | #else |
179 | iv=&ovec[0]; | 179 | 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 @@ | |||
1 | /* $OpenBSD: ctr128.c,v 1.4 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: ctr128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2008 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2008 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -83,7 +83,7 @@ ctr128_inc_aligned(unsigned char *counter) | |||
83 | { | 83 | { |
84 | size_t *data,c,n; | 84 | size_t *data,c,n; |
85 | 85 | ||
86 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 86 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
87 | ctr128_inc(counter); | 87 | ctr128_inc(counter); |
88 | return; | 88 | return; |
89 | } | 89 | } |
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 @@ | |||
1 | /* $OpenBSD: gcm128.c,v 1.9 2014/06/27 06:07:35 deraadt Exp $ */ | 1 | /* $OpenBSD: gcm128.c,v 1.10 2014/07/09 16:06:13 miod Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -231,7 +231,7 @@ static void gcm_gmult_8bit(u64 Xi[2], const u128 Htable[256]) | |||
231 | Z.hi ^= (u64)rem_8bit[rem]<<32; | 231 | Z.hi ^= (u64)rem_8bit[rem]<<32; |
232 | } | 232 | } |
233 | 233 | ||
234 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 234 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
235 | #ifdef BSWAP8 | 235 | #ifdef BSWAP8 |
236 | Xi[0] = BSWAP8(Z.hi); | 236 | Xi[0] = BSWAP8(Z.hi); |
237 | Xi[1] = BSWAP8(Z.lo); | 237 | Xi[1] = BSWAP8(Z.lo); |
@@ -308,7 +308,7 @@ static void gcm_init_4bit(u128 Htable[16], u64 H[2]) | |||
308 | { | 308 | { |
309 | int j; | 309 | int j; |
310 | 310 | ||
311 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 311 | if (BYTE_ORDER == LITTLE_ENDIAN) |
312 | for (j=0;j<16;++j) { | 312 | for (j=0;j<16;++j) { |
313 | V = Htable[j]; | 313 | V = Htable[j]; |
314 | Htable[j].hi = V.lo; | 314 | Htable[j].hi = V.lo; |
@@ -374,7 +374,7 @@ static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16]) | |||
374 | Z.lo ^= Htable[nlo].lo; | 374 | Z.lo ^= Htable[nlo].lo; |
375 | } | 375 | } |
376 | 376 | ||
377 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 377 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
378 | #ifdef BSWAP8 | 378 | #ifdef BSWAP8 |
379 | Xi[0] = BSWAP8(Z.hi); | 379 | Xi[0] = BSWAP8(Z.hi); |
380 | Xi[1] = BSWAP8(Z.lo); | 380 | Xi[1] = BSWAP8(Z.lo); |
@@ -543,7 +543,7 @@ static void gcm_ghash_4bit(u64 Xi[2],const u128 Htable[16], | |||
543 | Z.hi ^= ((u64)rem_8bit[rem<<4])<<48; | 543 | Z.hi ^= ((u64)rem_8bit[rem<<4])<<48; |
544 | #endif | 544 | #endif |
545 | 545 | ||
546 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 546 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
547 | #ifdef BSWAP8 | 547 | #ifdef BSWAP8 |
548 | Xi[0] = BSWAP8(Z.hi); | 548 | Xi[0] = BSWAP8(Z.hi); |
549 | Xi[1] = BSWAP8(Z.lo); | 549 | Xi[1] = BSWAP8(Z.lo); |
@@ -590,7 +590,7 @@ static void gcm_gmult_1bit(u64 Xi[2],const u64 H[2]) | |||
590 | V.lo = H[1]; | 590 | V.lo = H[1]; |
591 | 591 | ||
592 | for (j=0; j<16/sizeof(long); ++j) { | 592 | for (j=0; j<16/sizeof(long); ++j) { |
593 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 593 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
594 | if (sizeof(long)==8) { | 594 | if (sizeof(long)==8) { |
595 | #ifdef BSWAP8 | 595 | #ifdef BSWAP8 |
596 | X = (long)(BSWAP8(xi[j])); | 596 | X = (long)(BSWAP8(xi[j])); |
@@ -616,7 +616,7 @@ static void gcm_gmult_1bit(u64 Xi[2],const u64 H[2]) | |||
616 | } | 616 | } |
617 | } | 617 | } |
618 | 618 | ||
619 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 619 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
620 | #ifdef BSWAP8 | 620 | #ifdef BSWAP8 |
621 | Xi[0] = BSWAP8(Z.hi); | 621 | Xi[0] = BSWAP8(Z.hi); |
622 | Xi[1] = BSWAP8(Z.lo); | 622 | Xi[1] = BSWAP8(Z.lo); |
@@ -687,7 +687,7 @@ void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx,void *key,block128_f block) | |||
687 | 687 | ||
688 | (*block)(ctx->H.c,ctx->H.c,key); | 688 | (*block)(ctx->H.c,ctx->H.c,key); |
689 | 689 | ||
690 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 690 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
691 | /* H is stored in host byte order */ | 691 | /* H is stored in host byte order */ |
692 | #ifdef BSWAP8 | 692 | #ifdef BSWAP8 |
693 | ctx->H.u[0] = BSWAP8(ctx->H.u[0]); | 693 | 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) | |||
783 | GCM_MUL(ctx,Yi); | 783 | GCM_MUL(ctx,Yi); |
784 | } | 784 | } |
785 | len0 <<= 3; | 785 | len0 <<= 3; |
786 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 786 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
787 | #ifdef BSWAP8 | 787 | #ifdef BSWAP8 |
788 | ctx->Yi.u[1] ^= BSWAP8(len0); | 788 | ctx->Yi.u[1] ^= BSWAP8(len0); |
789 | #else | 789 | #else |
@@ -802,7 +802,7 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx,const unsigned char *iv,size_t len) | |||
802 | 802 | ||
803 | GCM_MUL(ctx,Yi); | 803 | GCM_MUL(ctx,Yi); |
804 | 804 | ||
805 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 805 | if (BYTE_ORDER == LITTLE_ENDIAN) |
806 | #ifdef BSWAP4 | 806 | #ifdef BSWAP4 |
807 | ctr = BSWAP4(ctx->Yi.d[3]); | 807 | ctr = BSWAP4(ctx->Yi.d[3]); |
808 | #else | 808 | #else |
@@ -814,7 +814,7 @@ void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx,const unsigned char *iv,size_t len) | |||
814 | 814 | ||
815 | (*ctx->block)(ctx->Yi.c,ctx->EK0.c,ctx->key); | 815 | (*ctx->block)(ctx->Yi.c,ctx->EK0.c,ctx->key); |
816 | ++ctr; | 816 | ++ctr; |
817 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 817 | if (BYTE_ORDER == LITTLE_ENDIAN) |
818 | #ifdef BSWAP4 | 818 | #ifdef BSWAP4 |
819 | ctx->Yi.d[3] = BSWAP4(ctr); | 819 | ctx->Yi.d[3] = BSWAP4(ctr); |
820 | #else | 820 | #else |
@@ -912,7 +912,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
912 | ctx->ares = 0; | 912 | ctx->ares = 0; |
913 | } | 913 | } |
914 | 914 | ||
915 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 915 | if (BYTE_ORDER == LITTLE_ENDIAN) |
916 | #ifdef BSWAP4 | 916 | #ifdef BSWAP4 |
917 | ctr = BSWAP4(ctx->Yi.d[3]); | 917 | ctr = BSWAP4(ctx->Yi.d[3]); |
918 | #else | 918 | #else |
@@ -950,7 +950,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
950 | 950 | ||
951 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 951 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
952 | ++ctr; | 952 | ++ctr; |
953 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 953 | if (BYTE_ORDER == LITTLE_ENDIAN) |
954 | #ifdef BSWAP4 | 954 | #ifdef BSWAP4 |
955 | ctx->Yi.d[3] = BSWAP4(ctr); | 955 | ctx->Yi.d[3] = BSWAP4(ctr); |
956 | #else | 956 | #else |
@@ -976,7 +976,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
976 | 976 | ||
977 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 977 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
978 | ++ctr; | 978 | ++ctr; |
979 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 979 | if (BYTE_ORDER == LITTLE_ENDIAN) |
980 | #ifdef BSWAP4 | 980 | #ifdef BSWAP4 |
981 | ctx->Yi.d[3] = BSWAP4(ctr); | 981 | ctx->Yi.d[3] = BSWAP4(ctr); |
982 | #else | 982 | #else |
@@ -999,7 +999,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
999 | 999 | ||
1000 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1000 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1001 | ++ctr; | 1001 | ++ctr; |
1002 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1002 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1003 | #ifdef BSWAP4 | 1003 | #ifdef BSWAP4 |
1004 | ctx->Yi.d[3] = BSWAP4(ctr); | 1004 | ctx->Yi.d[3] = BSWAP4(ctr); |
1005 | #else | 1005 | #else |
@@ -1019,7 +1019,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
1019 | if (len) { | 1019 | if (len) { |
1020 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1020 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1021 | ++ctr; | 1021 | ++ctr; |
1022 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1022 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1023 | #ifdef BSWAP4 | 1023 | #ifdef BSWAP4 |
1024 | ctx->Yi.d[3] = BSWAP4(ctr); | 1024 | ctx->Yi.d[3] = BSWAP4(ctr); |
1025 | #else | 1025 | #else |
@@ -1041,7 +1041,7 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, | |||
1041 | if (n==0) { | 1041 | if (n==0) { |
1042 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1042 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1043 | ++ctr; | 1043 | ++ctr; |
1044 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1044 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1045 | #ifdef BSWAP4 | 1045 | #ifdef BSWAP4 |
1046 | ctx->Yi.d[3] = BSWAP4(ctr); | 1046 | ctx->Yi.d[3] = BSWAP4(ctr); |
1047 | #else | 1047 | #else |
@@ -1088,7 +1088,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1088 | ctx->ares = 0; | 1088 | ctx->ares = 0; |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1091 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1092 | #ifdef BSWAP4 | 1092 | #ifdef BSWAP4 |
1093 | ctr = BSWAP4(ctx->Yi.d[3]); | 1093 | ctr = BSWAP4(ctx->Yi.d[3]); |
1094 | #else | 1094 | #else |
@@ -1129,7 +1129,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1129 | 1129 | ||
1130 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1130 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1131 | ++ctr; | 1131 | ++ctr; |
1132 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1132 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1133 | #ifdef BSWAP4 | 1133 | #ifdef BSWAP4 |
1134 | ctx->Yi.d[3] = BSWAP4(ctr); | 1134 | ctx->Yi.d[3] = BSWAP4(ctr); |
1135 | #else | 1135 | #else |
@@ -1153,7 +1153,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1153 | 1153 | ||
1154 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1154 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1155 | ++ctr; | 1155 | ++ctr; |
1156 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1156 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1157 | #ifdef BSWAP4 | 1157 | #ifdef BSWAP4 |
1158 | ctx->Yi.d[3] = BSWAP4(ctr); | 1158 | ctx->Yi.d[3] = BSWAP4(ctr); |
1159 | #else | 1159 | #else |
@@ -1175,7 +1175,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1175 | 1175 | ||
1176 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1176 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1177 | ++ctr; | 1177 | ++ctr; |
1178 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1178 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1179 | #ifdef BSWAP4 | 1179 | #ifdef BSWAP4 |
1180 | ctx->Yi.d[3] = BSWAP4(ctr); | 1180 | ctx->Yi.d[3] = BSWAP4(ctr); |
1181 | #else | 1181 | #else |
@@ -1197,7 +1197,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1197 | if (len) { | 1197 | if (len) { |
1198 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1198 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1199 | ++ctr; | 1199 | ++ctr; |
1200 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1200 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1201 | #ifdef BSWAP4 | 1201 | #ifdef BSWAP4 |
1202 | ctx->Yi.d[3] = BSWAP4(ctr); | 1202 | ctx->Yi.d[3] = BSWAP4(ctr); |
1203 | #else | 1203 | #else |
@@ -1222,7 +1222,7 @@ int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, | |||
1222 | if (n==0) { | 1222 | if (n==0) { |
1223 | (*block)(ctx->Yi.c,ctx->EKi.c,key); | 1223 | (*block)(ctx->Yi.c,ctx->EKi.c,key); |
1224 | ++ctr; | 1224 | ++ctr; |
1225 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1225 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1226 | #ifdef BSWAP4 | 1226 | #ifdef BSWAP4 |
1227 | ctx->Yi.d[3] = BSWAP4(ctr); | 1227 | ctx->Yi.d[3] = BSWAP4(ctr); |
1228 | #else | 1228 | #else |
@@ -1270,7 +1270,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1270 | ctx->ares = 0; | 1270 | ctx->ares = 0; |
1271 | } | 1271 | } |
1272 | 1272 | ||
1273 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1273 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1274 | #ifdef BSWAP4 | 1274 | #ifdef BSWAP4 |
1275 | ctr = BSWAP4(ctx->Yi.d[3]); | 1275 | ctr = BSWAP4(ctx->Yi.d[3]); |
1276 | #else | 1276 | #else |
@@ -1296,7 +1296,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1296 | while (len>=GHASH_CHUNK) { | 1296 | while (len>=GHASH_CHUNK) { |
1297 | (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); | 1297 | (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); |
1298 | ctr += GHASH_CHUNK/16; | 1298 | ctr += GHASH_CHUNK/16; |
1299 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1299 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1300 | #ifdef BSWAP4 | 1300 | #ifdef BSWAP4 |
1301 | ctx->Yi.d[3] = BSWAP4(ctr); | 1301 | ctx->Yi.d[3] = BSWAP4(ctr); |
1302 | #else | 1302 | #else |
@@ -1315,7 +1315,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1315 | 1315 | ||
1316 | (*stream)(in,out,j,key,ctx->Yi.c); | 1316 | (*stream)(in,out,j,key,ctx->Yi.c); |
1317 | ctr += (unsigned int)j; | 1317 | ctr += (unsigned int)j; |
1318 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1318 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1319 | #ifdef BSWAP4 | 1319 | #ifdef BSWAP4 |
1320 | ctx->Yi.d[3] = BSWAP4(ctr); | 1320 | ctx->Yi.d[3] = BSWAP4(ctr); |
1321 | #else | 1321 | #else |
@@ -1339,7 +1339,7 @@ int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1339 | if (len) { | 1339 | if (len) { |
1340 | (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); | 1340 | (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); |
1341 | ++ctr; | 1341 | ++ctr; |
1342 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1342 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1343 | #ifdef BSWAP4 | 1343 | #ifdef BSWAP4 |
1344 | ctx->Yi.d[3] = BSWAP4(ctr); | 1344 | ctx->Yi.d[3] = BSWAP4(ctr); |
1345 | #else | 1345 | #else |
@@ -1384,7 +1384,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1384 | ctx->ares = 0; | 1384 | ctx->ares = 0; |
1385 | } | 1385 | } |
1386 | 1386 | ||
1387 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1387 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1388 | #ifdef BSWAP4 | 1388 | #ifdef BSWAP4 |
1389 | ctr = BSWAP4(ctx->Yi.d[3]); | 1389 | ctr = BSWAP4(ctx->Yi.d[3]); |
1390 | #else | 1390 | #else |
@@ -1413,7 +1413,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1413 | GHASH(ctx,in,GHASH_CHUNK); | 1413 | GHASH(ctx,in,GHASH_CHUNK); |
1414 | (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); | 1414 | (*stream)(in,out,GHASH_CHUNK/16,key,ctx->Yi.c); |
1415 | ctr += GHASH_CHUNK/16; | 1415 | ctr += GHASH_CHUNK/16; |
1416 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1416 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1417 | #ifdef BSWAP4 | 1417 | #ifdef BSWAP4 |
1418 | ctx->Yi.d[3] = BSWAP4(ctr); | 1418 | ctx->Yi.d[3] = BSWAP4(ctr); |
1419 | #else | 1419 | #else |
@@ -1443,7 +1443,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1443 | #endif | 1443 | #endif |
1444 | (*stream)(in,out,j,key,ctx->Yi.c); | 1444 | (*stream)(in,out,j,key,ctx->Yi.c); |
1445 | ctr += (unsigned int)j; | 1445 | ctr += (unsigned int)j; |
1446 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1446 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1447 | #ifdef BSWAP4 | 1447 | #ifdef BSWAP4 |
1448 | ctx->Yi.d[3] = BSWAP4(ctr); | 1448 | ctx->Yi.d[3] = BSWAP4(ctr); |
1449 | #else | 1449 | #else |
@@ -1458,7 +1458,7 @@ int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, | |||
1458 | if (len) { | 1458 | if (len) { |
1459 | (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); | 1459 | (*ctx->block)(ctx->Yi.c,ctx->EKi.c,key); |
1460 | ++ctr; | 1460 | ++ctr; |
1461 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 1461 | if (BYTE_ORDER == LITTLE_ENDIAN) |
1462 | #ifdef BSWAP4 | 1462 | #ifdef BSWAP4 |
1463 | ctx->Yi.d[3] = BSWAP4(ctr); | 1463 | ctx->Yi.d[3] = BSWAP4(ctr); |
1464 | #else | 1464 | #else |
@@ -1490,7 +1490,7 @@ int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag, | |||
1490 | if (ctx->mres || ctx->ares) | 1490 | if (ctx->mres || ctx->ares) |
1491 | GCM_MUL(ctx,Xi); | 1491 | GCM_MUL(ctx,Xi); |
1492 | 1492 | ||
1493 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 1493 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
1494 | #ifdef BSWAP8 | 1494 | #ifdef BSWAP8 |
1495 | alen = BSWAP8(alen); | 1495 | alen = BSWAP8(alen); |
1496 | clen = BSWAP8(clen); | 1496 | 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 @@ | |||
1 | /* $OpenBSD: xts128.c,v 1.4 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: xts128.c,v 1.5 2014/07/09 16:06:13 miod Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2011 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -99,7 +99,7 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], | |||
99 | 99 | ||
100 | if (len==0) return 0; | 100 | if (len==0) return 0; |
101 | 101 | ||
102 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 102 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
103 | unsigned int carry,res; | 103 | unsigned int carry,res; |
104 | 104 | ||
105 | res = 0x87&(((int)tweak.d[3])>>31); | 105 | res = 0x87&(((int)tweak.d[3])>>31); |
@@ -135,7 +135,7 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16], | |||
135 | else { | 135 | else { |
136 | union { u64 u[2]; u8 c[16]; } tweak1; | 136 | union { u64 u[2]; u8 c[16]; } tweak1; |
137 | 137 | ||
138 | if (_BYTE_ORDER == _LITTLE_ENDIAN) { | 138 | if (BYTE_ORDER == LITTLE_ENDIAN) { |
139 | unsigned int carry,res; | 139 | unsigned int carry,res; |
140 | 140 | ||
141 | res = 0x87&(((int)tweak.d[3])>>31); | 141 | 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 @@ | |||
1 | /* $OpenBSD: rc4_enc.c,v 1.11 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: rc4_enc.c,v 1.12 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 | * |
@@ -150,7 +150,7 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, | |||
150 | * | 150 | * |
151 | * <appro@fy.chalmers.se> | 151 | * <appro@fy.chalmers.se> |
152 | */ | 152 | */ |
153 | if (_BYTE_ORDER != _LITTLE_ENDIAN) | 153 | if (BYTE_ORDER != LITTLE_ENDIAN) |
154 | { /* BIG-ENDIAN CASE */ | 154 | { /* BIG-ENDIAN CASE */ |
155 | # define BESHFT(c) (((sizeof(RC4_CHUNK)-(c)-1)*8)&(sizeof(RC4_CHUNK)*8-1)) | 155 | # define BESHFT(c) (((sizeof(RC4_CHUNK)-(c)-1)*8)&(sizeof(RC4_CHUNK)*8-1)) |
156 | for (;len&(0-sizeof(RC4_CHUNK));len-=sizeof(RC4_CHUNK)) | 156 | 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 @@ | |||
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/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 @@ | |||
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/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 @@ | |||
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; |
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 @@ | |||
1 | /* $OpenBSD: wp_block.c,v 1.8 2014/07/08 16:15:20 miod Exp $ */ | 1 | /* $OpenBSD: wp_block.c,v 1.9 2014/07/09 16:06:13 miod Exp $ */ |
2 | /** | 2 | /** |
3 | * The Whirlpool hashing function. | 3 | * The Whirlpool hashing function. |
4 | * | 4 | * |
@@ -76,7 +76,7 @@ typedef unsigned long long u64; | |||
76 | # define ROTATE(a,n) ({ u64 ret; asm ("rolq %1,%0" \ | 76 | # define ROTATE(a,n) ({ u64 ret; asm ("rolq %1,%0" \ |
77 | : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; }) | 77 | : "=r"(ret) : "J"(n),"0"(a) : "cc"); ret; }) |
78 | # elif defined(__ia64) || defined(__ia64__) | 78 | # elif defined(__ia64) || defined(__ia64__) |
79 | # if _BYTE_ORDER == _LITTLE_ENDIAN | 79 | # if BYTE_ORDER == LITTLE_ENDIAN |
80 | # define ROTATE(a,n) ({ u64 ret; asm ("shrp %0=%1,%1,%2" \ | 80 | # define ROTATE(a,n) ({ u64 ret; asm ("shrp %0=%1,%1,%2" \ |
81 | : "=r"(ret) : "r"(a),"M"(64-(n))); ret; }) | 81 | : "=r"(ret) : "r"(a),"M"(64-(n))); ret; }) |
82 | # else | 82 | # else |
@@ -88,7 +88,7 @@ typedef unsigned long long u64; | |||
88 | 88 | ||
89 | #if defined(OPENSSL_SMALL_FOOTPRINT) | 89 | #if defined(OPENSSL_SMALL_FOOTPRINT) |
90 | # if !defined(ROTATE) | 90 | # if !defined(ROTATE) |
91 | # if _BYTE_ORDER == _LITTLE_ENDIAN /* little-endians have to rotate left */ | 91 | # if BYTE_ORDER == LITTLE_ENDIAN /* little-endians have to rotate left */ |
92 | # define ROTATE(i,n) ((i)<<(n) ^ (i)>>(64-n)) | 92 | # define ROTATE(i,n) ((i)<<(n) ^ (i)>>(64-n)) |
93 | # else /* big-endians have to rotate right */ | 93 | # else /* big-endians have to rotate right */ |
94 | # define ROTATE(i,n) ((i)>>(n) ^ (i)<<(64-n)) | 94 | # 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 @@ | |||
1 | /* $OpenBSD: d1_pkt.c,v 1.30 2014/06/19 21:29:51 tedu Exp $ */ | 1 | /* $OpenBSD: d1_pkt.c,v 1.31 2014/07/09 16:06:14 miod Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -133,7 +133,7 @@ satsub64be(const unsigned char *v1, const unsigned char *v2) | |||
133 | do { | 133 | do { |
134 | long l; | 134 | long l; |
135 | 135 | ||
136 | if (_BYTE_ORDER == _LITTLE_ENDIAN) | 136 | if (BYTE_ORDER == LITTLE_ENDIAN) |
137 | break; | 137 | break; |
138 | /* not reached on little-endians */ | 138 | /* not reached on little-endians */ |
139 | /* following test is redundant, because input is | 139 | /* following test is redundant, because input is |