diff options
author | inoguchi <> | 2017-09-03 13:07:34 +0000 |
---|---|---|
committer | inoguchi <> | 2017-09-03 13:07:34 +0000 |
commit | ec1b9739d1881112264d7fe9aac0d7924e149b28 (patch) | |
tree | dabdd83d80cb48e166d7e4624f9c3cfa84ce64f2 /src/lib/libcrypto/modes | |
parent | acb50b384a345af5c252cecb7b199227f056184f (diff) | |
download | openbsd-ec1b9739d1881112264d7fe9aac0d7924e149b28.tar.gz openbsd-ec1b9739d1881112264d7fe9aac0d7924e149b28.tar.bz2 openbsd-ec1b9739d1881112264d7fe9aac0d7924e149b28.zip |
Checking sizeof size_t by SIZE_MAX instead of _LP64
ok bcook@
Diffstat (limited to 'src/lib/libcrypto/modes')
-rw-r--r-- | src/lib/libcrypto/modes/gcm128.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/modes/gcm128.c b/src/lib/libcrypto/modes/gcm128.c index a21abe6ded..69b1dd4f49 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.19 2017/08/30 12:09:02 inoguchi Exp $ */ | 1 | /* $OpenBSD: gcm128.c,v 1.20 2017/09/03 13:07:34 inoguchi 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 | * |
@@ -224,7 +224,7 @@ static void gcm_gmult_8bit(u64 Xi[2], const u128 Htable[256]) | |||
224 | rem = (size_t)Z.lo&0xff; | 224 | rem = (size_t)Z.lo&0xff; |
225 | Z.lo = (Z.hi<<56)|(Z.lo>>8); | 225 | Z.lo = (Z.hi<<56)|(Z.lo>>8); |
226 | Z.hi = (Z.hi>>8); | 226 | Z.hi = (Z.hi>>8); |
227 | #ifdef _LP64 | 227 | #if SIZE_MAX == 0xffffffffffffffff |
228 | Z.hi ^= rem_8bit[rem]; | 228 | Z.hi ^= rem_8bit[rem]; |
229 | #else | 229 | #else |
230 | Z.hi ^= (u64)rem_8bit[rem]<<32; | 230 | Z.hi ^= (u64)rem_8bit[rem]<<32; |
@@ -347,7 +347,7 @@ static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16]) | |||
347 | rem = (size_t)Z.lo&0xf; | 347 | rem = (size_t)Z.lo&0xf; |
348 | Z.lo = (Z.hi<<60)|(Z.lo>>4); | 348 | Z.lo = (Z.hi<<60)|(Z.lo>>4); |
349 | Z.hi = (Z.hi>>4); | 349 | Z.hi = (Z.hi>>4); |
350 | #ifdef _LP64 | 350 | #if SIZE_MAX == 0xffffffffffffffff |
351 | Z.hi ^= rem_4bit[rem]; | 351 | Z.hi ^= rem_4bit[rem]; |
352 | #else | 352 | #else |
353 | Z.hi ^= (u64)rem_4bit[rem]<<32; | 353 | Z.hi ^= (u64)rem_4bit[rem]<<32; |
@@ -364,7 +364,7 @@ static void gcm_gmult_4bit(u64 Xi[2], const u128 Htable[16]) | |||
364 | rem = (size_t)Z.lo&0xf; | 364 | rem = (size_t)Z.lo&0xf; |
365 | Z.lo = (Z.hi<<60)|(Z.lo>>4); | 365 | Z.lo = (Z.hi<<60)|(Z.lo>>4); |
366 | Z.hi = (Z.hi>>4); | 366 | Z.hi = (Z.hi>>4); |
367 | #ifdef _LP64 | 367 | #if SIZE_MAX == 0xffffffffffffffff |
368 | Z.hi ^= rem_4bit[rem]; | 368 | Z.hi ^= rem_4bit[rem]; |
369 | #else | 369 | #else |
370 | Z.hi ^= (u64)rem_4bit[rem]<<32; | 370 | Z.hi ^= (u64)rem_4bit[rem]<<32; |
@@ -421,7 +421,7 @@ static void gcm_ghash_4bit(u64 Xi[2],const u128 Htable[16], | |||
421 | rem = (size_t)Z.lo&0xf; | 421 | rem = (size_t)Z.lo&0xf; |
422 | Z.lo = (Z.hi<<60)|(Z.lo>>4); | 422 | Z.lo = (Z.hi<<60)|(Z.lo>>4); |
423 | Z.hi = (Z.hi>>4); | 423 | Z.hi = (Z.hi>>4); |
424 | #ifdef _LP64 | 424 | #if SIZE_MAX == 0xffffffffffffffff |
425 | Z.hi ^= rem_4bit[rem]; | 425 | Z.hi ^= rem_4bit[rem]; |
426 | #else | 426 | #else |
427 | Z.hi ^= (u64)rem_4bit[rem]<<32; | 427 | Z.hi ^= (u64)rem_4bit[rem]<<32; |
@@ -439,7 +439,7 @@ static void gcm_ghash_4bit(u64 Xi[2],const u128 Htable[16], | |||
439 | rem = (size_t)Z.lo&0xf; | 439 | rem = (size_t)Z.lo&0xf; |
440 | Z.lo = (Z.hi<<60)|(Z.lo>>4); | 440 | Z.lo = (Z.hi<<60)|(Z.lo>>4); |
441 | Z.hi = (Z.hi>>4); | 441 | Z.hi = (Z.hi>>4); |
442 | #ifdef _LP64 | 442 | #if SIZE_MAX == 0xffffffffffffffff |
443 | Z.hi ^= rem_4bit[rem]; | 443 | Z.hi ^= rem_4bit[rem]; |
444 | #else | 444 | #else |
445 | Z.hi ^= (u64)rem_4bit[rem]<<32; | 445 | Z.hi ^= (u64)rem_4bit[rem]<<32; |
@@ -588,7 +588,7 @@ static void gcm_gmult_1bit(u64 Xi[2],const u64 H[2]) | |||
588 | 588 | ||
589 | for (j=0; j<16/sizeof(long); ++j) { | 589 | for (j=0; j<16/sizeof(long); ++j) { |
590 | #if BYTE_ORDER == LITTLE_ENDIAN | 590 | #if BYTE_ORDER == LITTLE_ENDIAN |
591 | #ifdef _LP64 | 591 | #if SIZE_MAX == 0xffffffffffffffff |
592 | #ifdef BSWAP8 | 592 | #ifdef BSWAP8 |
593 | X = (long)(BSWAP8(xi[j])); | 593 | X = (long)(BSWAP8(xi[j])); |
594 | #else | 594 | #else |