From 84899d9d4ade744ac9be2e1bdadc2826dd33114d Mon Sep 17 00:00:00 2001 From: arnaucube Date: Fri, 10 Nov 2023 11:37:59 +0100 Subject: [PATCH] rm 128 bit constant --- src/constants.rs | 2 -- src/folding/nova/circuits.rs | 3 +-- src/transcript/poseidon.rs | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/constants.rs b/src/constants.rs index 5df7aa02..597fabb3 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,5 +1,3 @@ -// used for challenge r, so when computing r^2 it does not overflow the field -pub const N_BITS_CHALLENGE: usize = 128; // used for committed instances hash, so when going to the other curve of the cycle it does not // overflow the scalar field pub const N_BITS_HASH: usize = 250; diff --git a/src/folding/nova/circuits.rs b/src/folding/nova/circuits.rs index 960e9e4a..84ff07ee 100644 --- a/src/folding/nova/circuits.rs +++ b/src/folding/nova/circuits.rs @@ -436,7 +436,6 @@ pub mod tests { use tracing_subscriber::layer::SubscriberExt; use crate::ccs::r1cs::tests::{get_test_r1cs, get_test_z}; - use crate::constants::N_BITS_CHALLENGE; use crate::folding::nova::{nifs::NIFS, traits::NovaR1CS, Witness}; use crate::frontend::arkworks::{extract_r1cs, extract_z}; use crate::pedersen::Pedersen; @@ -521,7 +520,7 @@ pub mod tests { // transcript let poseidon_config = poseidon_test_config::(); let mut tr = PoseidonTranscript::::new(&poseidon_config); - let r_bits = tr.get_challenge_nbits(N_BITS_CHALLENGE); + let r_bits = tr.get_challenge_nbits(128); let r_Fr = Fr::from_bigint(BigInteger::from_bits_le(&r_bits)).unwrap(); let (_, ci3) = diff --git a/src/transcript/poseidon.rs b/src/transcript/poseidon.rs index 7d5fed5e..efb50820 100644 --- a/src/transcript/poseidon.rs +++ b/src/transcript/poseidon.rs @@ -171,7 +171,7 @@ pub mod tests { #[test] fn test_transcript_and_transcriptvar_nbits() { - let nbits = crate::constants::N_BITS_CHALLENGE; + let nbits = 128; // use 'native' transcript let config = poseidon_test_config::();