Skip to content

Commit

Permalink
WiP debugging sha256 build
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 committed May 30, 2023
1 parent c7722be commit 5712466
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion cpp/src/barretenberg/benchmark/honk_bench/ultra_honk.bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <benchmark/benchmark.h>
#include <cstddef>
#include "barretenberg/honk/composer/ultra_honk_composer.hpp"
#include "barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp"
#include "barretenberg/stdlib/hash/sha256/sha256.hpp"

using namespace benchmark;

Expand Down Expand Up @@ -32,6 +34,20 @@ void generate_test_circuit(auto& composer, size_t num_gates)
}
}

void generate_sha256_test_circuit(Composer& composer, size_t num_gates)
{
std::string in;
in.resize(32);
for (size_t i = 0; i < 32; ++i) {
in[i] = 0;
}
size_t num_iterations = 10;
proof_system::plonk::stdlib::packed_byte_array<Composer> input(&composer, in);
for (size_t i = 0; i < num_iterations; i++) {
input = proof_system::plonk::stdlib::sha256<Composer>(input);
}
}

/**
* @brief Benchmark: Creation of a Ultra Honk prover
*/
Expand All @@ -41,7 +57,8 @@ void create_prover_ultra(State& state) noexcept
state.PauseTiming();
auto num_gates = 1 << (size_t)state.range(0);
auto composer = Composer();
generate_test_circuit(composer, static_cast<size_t>(num_gates));
generate_sha256_test_circuit(composer, static_cast<size_t>(num_gates));
// generate_test_circuit(composer, static_cast<size_t>(num_gates));
state.ResumeTiming();

auto prover = composer.create_prover();
Expand Down
1 change: 1 addition & 0 deletions cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace proof_system::plonk {
class UltraPlonkComposer;
class StandardPlonkComposer;
class TurboPlonkComposer;
class UltraHonkComposer;
} // namespace proof_system::plonk

namespace proof_system::plonk {
Expand Down

0 comments on commit 5712466

Please sign in to comment.