From 1386e08f2b39244cfed54ea54e77f5f88e960e09 Mon Sep 17 00:00:00 2001 From: Martun Karapetyan Date: Fri, 3 May 2024 11:24:58 +0000 Subject: [PATCH] Temporarily add logging of challenges, to catch a bug on CI. --- .../nil/crypto3/zk/transcript/fiat_shamir.hpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/include/nil/crypto3/zk/transcript/fiat_shamir.hpp b/include/nil/crypto3/zk/transcript/fiat_shamir.hpp index 95a51e00..17a6208f 100644 --- a/include/nil/crypto3/zk/transcript/fiat_shamir.hpp +++ b/include/nil/crypto3/zk/transcript/fiat_shamir.hpp @@ -151,6 +151,11 @@ namespace nil { template void operator()(const InputRange &r) { +std::cout << "Next inputs are: "; +for (const auto& f: r) + std::cout << (int)f << " "; +std::cout << std::endl << std::endl; + auto acc_convertible = hash(state); state = accumulators::extract::hash( hash(r, static_cast &>(acc_convertible))); @@ -158,6 +163,10 @@ namespace nil { template void operator()(InputIterator first, InputIterator last) { +std::cout << "Next inputs iter are:"; +for (InputIterator it = first; it != last; ++it) + std::cout << *it << " "; +std::cout << std::endl << std::endl; auto acc_convertible = hash(state); state = accumulators::extract::hash( hash(first, last, static_cast &>(acc_convertible))); @@ -171,6 +180,7 @@ namespace nil { state = hash(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; } @@ -180,6 +190,7 @@ namespace nil { state = hash(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; } @@ -189,6 +200,7 @@ namespace nil { std::array challenges() { std::array result; +std::cout << "Next challenges are: " << std::endl; for (auto &ch : result) { ch = challenge(); } @@ -258,7 +270,9 @@ namespace nil { template 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 @@ -276,6 +290,7 @@ namespace nil { intermediate_result = intermediate_result / 0x100; bytes_to_fill -= 2; } +std::cout << "Next Poseidon int challenge is "<< result << std::endl; return result; } @@ -283,6 +298,7 @@ namespace nil { std::array challenges() { std::array result; +std::cout << "Next Poseidon challenges are: " << std::endl; for (auto &ch : result) { ch = challenge(); }