From d44d508748b62ef7e64e8503e10910fd9a736bed Mon Sep 17 00:00:00 2001 From: jsing Date: Sat, 15 Apr 2023 18:29:26 +0000 Subject: [PATCH] Move some defines out of the sha3_internal.h header. --- lib/libcrypto/sha/sha3.c | 6 +++++- lib/libcrypto/sha/sha3_internal.h | 10 +--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/libcrypto/sha/sha3.c b/lib/libcrypto/sha/sha3.c index a3ef95f8154..acb7de7d9d2 100644 --- a/lib/libcrypto/sha/sha3.c +++ b/lib/libcrypto/sha/sha3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha3.c,v 1.6 2023/04/15 18:19:06 jsing Exp $ */ +/* $OpenBSD: sha3.c,v 1.7 2023/04/15 18:29:26 jsing Exp $ */ /* * The MIT License (MIT) * @@ -25,6 +25,10 @@ #include "sha3_internal.h" +#define KECCAKF_ROUNDS 24 + +#define ROTL64(x, y) (((x) << (y)) | ((x) >> (64 - (y)))) + static const uint64_t sha3_keccakf_rndc[24] = { 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b, 0x0000000080000001, diff --git a/lib/libcrypto/sha/sha3_internal.h b/lib/libcrypto/sha/sha3_internal.h index 1ed4b02f7cf..20144effd10 100644 --- a/lib/libcrypto/sha/sha3_internal.h +++ b/lib/libcrypto/sha/sha3_internal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sha3_internal.h,v 1.5 2023/04/15 18:22:53 jsing Exp $ */ +/* $OpenBSD: sha3_internal.h,v 1.6 2023/04/15 18:29:26 jsing Exp $ */ /* * The MIT License (MIT) * @@ -29,14 +29,6 @@ #ifndef HEADER_SHA3_INTERNAL_H #define HEADER_SHA3_INTERNAL_H -#ifndef KECCAKF_ROUNDS -#define KECCAKF_ROUNDS 24 -#endif - -#ifndef ROTL64 -#define ROTL64(x, y) (((x) << (y)) | ((x) >> (64 - (y)))) -#endif - typedef struct { union { uint8_t b[200]; /* State as 8 bit bytes. */ -- 2.20.1