From 59bf3d072ab055d504f2d5bb3bbac9fc81c38b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=BA=C3=B1ez?= Date: Wed, 24 Jul 2024 20:24:01 +0200 Subject: [PATCH] Just for investigation purposes: check what transcripts are correct Note that this makes the test to trivially pass, but we're interested in the console output. Run with `cargo test --no-default-features parse_file -- --nocapture` --- ferveo/src/pvss.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ferveo/src/pvss.rs b/ferveo/src/pvss.rs index 20e3b52a..3e0fe5a5 100644 --- a/ferveo/src/pvss.rs +++ b/ferveo/src/pvss.rs @@ -244,7 +244,13 @@ pub fn do_verify_full( // We verify that e(G, Y_i) = e(A_i, ek_i) for validator i // See #4 in 4.2.3 section of https://eprint.iacr.org/2022/898.pdf // e(G,Y) = e(A, ek) - E::pairing(pvss_params.g, *y_i) == E::pairing(a_i, ek_i) + let r = E::pairing(pvss_params.g, *y_i) == E::pairing(a_i, ek_i); + if !r { + println!("Failed transc {} ({})", share_index, validator.address); + } else { + println!("All good with {} ({})", share_index, validator.address); + } + true }) }