Skip to content

Commit

Permalink
Temporarily add logging of challenges, to catch a bug on CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
martun committed May 3, 2024
1 parent a96e603 commit 8e7b6d3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/nil/crypto3/zk/transcript/fiat_shamir.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ namespace nil {
state = hash<hash_type>(state);
nil::marshalling::status_type status;
nil::crypto3::multiprecision::cpp_int raw_result = nil::marshalling::pack(state, status);
std::cout << "Next challenge is " << raw_result << std::endl;
return raw_result;
}

Expand All @@ -180,6 +181,7 @@ namespace nil {
state = hash<hash_type>(state);
nil::marshalling::status_type status;
Integral raw_result = nil::marshalling::pack(state, status);
std::cout << "Next int_challenge is " << raw_result << std::endl;
return raw_result;
}

Expand All @@ -189,6 +191,7 @@ namespace nil {
std::array<typename Field::value_type, N> challenges() {

std::array<typename Field::value_type, N> result;
std::cout << "Next challenges are: " << std::endl;
for (auto &ch : result) {
ch = challenge<Field>();
}
Expand Down Expand Up @@ -258,7 +261,9 @@ namespace nil {

template<typename Field>
typename Field::value_type challenge() {
return sponge.squeeze();
typename Field::value_type result = sponge.squeeze();
std::cout << "Next Poseidon challenge is "<< result << std::endl;
return result;
}

template<typename Integral>
Expand All @@ -276,13 +281,15 @@ namespace nil {
intermediate_result = intermediate_result / 0x100;
bytes_to_fill -= 2;
}
std::cout << "Next Poseidon int challenge is "<< result << std::endl;
return result;
}

template<typename Field, std::size_t N>
std::array<typename Field::value_type, N> challenges() {

std::array<typename Field::value_type, N> result;
std::cout << "Next Poseidon challenges are: " << std::endl;
for (auto &ch : result) {
ch = challenge<Field>();
}
Expand Down

0 comments on commit 8e7b6d3

Please sign in to comment.