Skip to content

Commit

Permalink
Specialized double sha256 for 64 byte inputs
Browse files Browse the repository at this point in the history
Cherry-picked from: d0c9632
  • Loading branch information
sipa authored and xanimo committed Apr 25, 2024
1 parent dd69cde commit 1c08994
Show file tree
Hide file tree
Showing 4 changed files with 350 additions and 12 deletions.
9 changes: 9 additions & 0 deletions src/bench/crypto_hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ static void SHA256_32b(benchmark::State& state)
}
}

static void SHA256D64_1024(benchmark::State& state)
{
std::vector<uint8_t> in(64 * 1024, 0);
while (state.KeepRunning()) {
SHA256D64(in.data(), in.data(), 1024);
}
}

static void SHA512(benchmark::State& state)
{
uint8_t hash[CSHA512::OUTPUT_SIZE];
Expand Down Expand Up @@ -99,5 +107,6 @@ BENCHMARK(SHA512);

BENCHMARK(SHA256_32b);
BENCHMARK(SipHash_32b);
BENCHMARK(SHA256D64_1024);
BENCHMARK(FastRandom_32bit);
BENCHMARK(FastRandom_1bit);
Loading

0 comments on commit 1c08994

Please sign in to comment.