From ac5713a6a7a19fdd788d5920a8c6d7c4d2ae9f73 Mon Sep 17 00:00:00 2001 From: jsing Date: Sat, 15 Apr 2023 19:15:53 +0000 Subject: [PATCH] Use the same byte order tests as we do elsewhere in libcrypto. --- lib/libcrypto/sha/sha3.c | 8 +++++--- 1 file 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 + #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]; -- 2.20.1