Skip to content

Commit

Permalink
Always use shani over avx2 in Merkle.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Dec 11, 2024
1 parent caee1ae commit 462822d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions include/bitcoin/system/impl/hash/sha/algorithm_merkle.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -401,18 +401,13 @@ merkle_hash_vector(digests_t& digests) NOEXCEPT
auto idigests = idigests_t{ to_half(size), data };
const auto start = iblocks.size();

// Merkle hash vector dispatch.
// Always use if available.
if constexpr (use_x512)
merkle_hash_vector<xint512_t>(idigests, iblocks);

// Use if shani is not available or at least 32 blocks.
if constexpr (use_x256)
{
if constexpr (!native)
merkle_hash_vector<xint256_t>(idigests, iblocks);
else if (start >= 32_size)
merkle_hash_vector<xint256_t>(idigests, iblocks);
}
// Only use if shani is not available.
if constexpr (use_x256 && !native)
merkle_hash_vector<xint256_t>(idigests, iblocks);

// Only use if shani is not available.
if constexpr (use_x128 && !native)
Expand Down

0 comments on commit 462822d

Please sign in to comment.