Skip to content

Commit

Permalink
determinism
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad0 committed Dec 8, 2023
1 parent a6c0843 commit 6cac29f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions barretenberg/cpp/src/barretenberg/numeric/random/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ namespace {
auto generate_random_data()
{
std::array<unsigned int, 32> random_data;
#ifdef BBERG_DEBUG_LOG
// if we are debug logging, don't actually use randomness, defeats the intended use-case of comparing runs
for (size_t i = 0; i < 32; i++) {
random_data[i] = unsigned(i + 1u);
}
#else
std::random_device source;
std::generate(std::begin(random_data), std::end(random_data), std::ref(source));
#endif
return random_data;
}
} // namespace
Expand Down

0 comments on commit 6cac29f

Please sign in to comment.