diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2023-04-15 19:15:54 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2023-04-15 19:15:54 +0000 |
commit | 27efdac3112c3ba9b3fadd12ecb3e6abe065f71f (patch) | |
tree | 5f5d9d61fe15002c21fce5a2e6447f0e4f6741ae /lib/libcrypto | |
parent | 5978d65a2c5839b1e13c94b6a0853894418832dc (diff) |
Use the same byte order tests as we do elsewhere in libcrypto.
Diffstat (limited to 'lib/libcrypto')
-rw-r--r-- | lib/libcrypto/sha/sha3.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libcrypto/sha/sha3.c b/lib/libcrypto/sha/sha3.c index 23019fb4d45..7b70d90c87e 100644 --- a/lib/libcrypto/sha/sha3.c +++ b/lib/libcrypto/sha/sha3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha3.c,v 1.9 2023/04/15 18:32:55 jsing Exp $ */ +/* $OpenBSD: sha3.c,v 1.10 2023/04/15 19:15:53 jsing Exp $ */ /* * The MIT License (MIT) * @@ -23,6 +23,8 @@ * SOFTWARE. */ +#include <endian.h> + #include "sha3_internal.h" #define KECCAKF_ROUNDS 24 @@ -54,7 +56,7 @@ sha3_keccakf(uint64_t st[25]) uint64_t t, bc[5]; int i, j, r; -#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ +#if BYTE_ORDER != LITTLE_ENDIAN uint8_t *v; for (i = 0; i < 25; i++) { @@ -99,7 +101,7 @@ sha3_keccakf(uint64_t st[25]) st[0] ^= sha3_keccakf_rndc[r]; } -#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ +#if BYTE_ORDER != LITTLE_ENDIAN for (i = 0; i < 25; i++) { v = (uint8_t *) &st[i]; t = st[i]; |