From 3e5ac04d5b77509e8022b0dbe6362c21c4e5d71e Mon Sep 17 00:00:00 2001 From: Daniel Scharrer <~@ds.me> Date: Tue, 7 Jan 2025 03:43:33 +0100 Subject: [PATCH] sha256: Force constants to be compile-time --- src/crypto/sha256.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/crypto/sha256.hpp b/src/crypto/sha256.hpp index ab2918a..12f35ad 100644 --- a/src/crypto/sha256.hpp +++ b/src/crypto/sha256.hpp @@ -39,9 +39,11 @@ public: typedef boost::uint32_t hash_word; typedef util::big_endian byte_order; - static const size_t offset = 1; - static const size_t block_size = 64; - static const size_t hash_size = 32; + enum constants { + offset = 1, + block_size = 64, + hash_size = 32, + }; static void init(hash_word * state);