From 5e22db2318f93ec9724b854bf8265cf4aaf6b60d Mon Sep 17 00:00:00 2001 From: WeebDataHoarder Date: Wed, 1 Oct 2025 16:01:00 +0200 Subject: [PATCH] add keccak() factor to hash_to_point to make points reproducible --- src/crypto/generators.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/crypto/generators.cpp b/src/crypto/generators.cpp index cc4259036..2a6540530 100644 --- a/src/crypto/generators.cpp +++ b/src/crypto/generators.cpp @@ -97,7 +97,10 @@ static std::once_flag init_gens_once_flag; //------------------------------------------------------------------------------------------------------------------- static void hash_to_point(const std::string_view &x, crypto::ec_point &point_out) { - unbiased_hash_to_ec((const unsigned char *) x.data(), x.size(), point_out); + hash temp_hash{cn_fast_hash(x.data(), x.size())}; + (void)temp_hash; //suppress unused warning + + unbiased_hash_to_ec(reinterpret_cast(&temp_hash), sizeof(hash), point_out); } //------------------------------------------------------------------------------------------------------------------- //------------------------------------------------------------------------------------------------------------------- -- 2.51.0