diff --git a/Stwo_wrapper/crates/prover/proof.json b/Stwo_wrapper/crates/prover/proof.json index aecce7d..eef777e 100644 --- a/Stwo_wrapper/crates/prover/proof.json +++ b/Stwo_wrapper/crates/prover/proof.json @@ -258,7 +258,7 @@ "coeffs" : ["329725079","667313404","2083859876","1645693780"], - "inner_commitment_0" : "19048435553851756854966583714228494720706220237110109487981675465058006706934", + "inner_commitment_0" : "45555755014923146766476222823122654194153582923386372098787021809602091298670", "inner_decommitment_0" : ["5462985033728555575703006689913665598917262836577853690370070265073174719979", @@ -280,7 +280,7 @@ ["3310770","2003547458","1663490902","2105455978"], ["824310523","1757518542","231582441","427507918"]], - "inner_commitment_1" : "18169576490546341141767046171814645645044172101340402424909425947818564934087", + "inner_commitment_1" : "36809196688918736785151875655523363274066842107451407514854169291514772437712", "inner_decommitment_1" : ["45836684762941279488847688946861562185184567552524644394596887832754938056979", @@ -299,7 +299,7 @@ ["1550507975","1444313548","117070947","1740854590"], ["342709844","601149328","1436490544","1384381104"]], - "inner_commitment_2" : "29215190960441505077529177935027039424488733477246157993605964254003539615792", + "inner_commitment_2" : "881819876414071785116043072319901261019430342891967010427739931379717752179", "inner_decommitment_2" : ["3578061893060038632121836895066391994380789049478144565795630968916166958170", @@ -315,7 +315,7 @@ ["716686867","138132852","2024080584","392488646"], ["606958913","308986056","258114411","2075401741"]], - "inner_commitment_3" : "33865913108527976063513611264849688092773721821534885464172308921150897546371", + "inner_commitment_3" : "12027868599227153144742193285247060272784688895537159385948117930165143367635", "inner_decommitment_3" : ["46510393127320994984678433868779353751380750916123221099220042551249644407575", @@ -328,7 +328,7 @@ ["2038210709","1600238918","655676259","1542271403"], ["1014579052","1384080403","862591487","1941843578"]], - "inner_commitment_4" : "233063347401903348432987619086774265933828676513621676247992038308030708388", + "inner_commitment_4" : "14412699124489796400221638504502701429059474709940645969751865021865037702257", "inner_decommitment_4" : ["19324767949149751902195880760061491860991545124249052461044586503970003688610"], @@ -338,7 +338,7 @@ ["2101847208","689925082","1602280602","1942656531"], ["1952987285","1995490213","2082219584","1620868519"]], - "inner_commitment_5" : "693572572477915449222328871061568563307509948116711167874020917953971074657", + "inner_commitment_5" : "7898658461322497542615494384418597990320440781916208640366283709415937814000", "inner_decommitment_5" : [], diff --git a/Stwo_wrapper/crates/prover/src/core/fri.rs b/Stwo_wrapper/crates/prover/src/core/fri.rs index db3e37d..0934c77 100644 --- a/Stwo_wrapper/crates/prover/src/core/fri.rs +++ b/Stwo_wrapper/crates/prover/src/core/fri.rs @@ -3,7 +3,6 @@ use std::collections::BTreeMap; use std::fmt::Debug; use std::iter::zip; use std::ops::RangeInclusive; - use itertools::Itertools; use num_traits::Zero; use thiserror::Error; diff --git a/Stwo_wrapper/crates/prover/src/core/pcs/quotients.rs b/Stwo_wrapper/crates/prover/src/core/pcs/quotients.rs index 1a41e83..1034e05 100644 --- a/Stwo_wrapper/crates/prover/src/core/pcs/quotients.rs +++ b/Stwo_wrapper/crates/prover/src/core/pcs/quotients.rs @@ -116,10 +116,10 @@ pub fn fri_answers( multiunzip(tuples); fri_answers_for_log_size( log_size, - &samples, + &samples, // Here it's the points and sampled values (in the proof) random_coeff, &query_domain_per_log_size[&log_size], - &queried_valued_per_column, + &queried_valued_per_column, // Here it's queried values (in the proof) ) }) .collect() @@ -141,7 +141,7 @@ pub fn fri_answers_for_log_size( )); } } - let mut queried_values_per_column = queried_values_per_column + let mut queried_values_per_column = queried_values_per_column .iter() .map(|q| q.iter()) .collect_vec(); diff --git a/Stwo_wrapper/crates/prover/src/core/pcs/verifier.rs b/Stwo_wrapper/crates/prover/src/core/pcs/verifier.rs index 812137f..da58a84 100644 --- a/Stwo_wrapper/crates/prover/src/core/pcs/verifier.rs +++ b/Stwo_wrapper/crates/prover/src/core/pcs/verifier.rs @@ -58,6 +58,7 @@ impl CommitmentSchemeVerifier { proof: CommitmentSchemeProof, channel: &mut MC::C, ) -> Result<(), VerificationError> { + channel.mix_felts(&proof.sampled_values.clone().flatten_cols()); let random_coeff = channel.draw_felt(); @@ -105,9 +106,10 @@ impl CommitmentSchemeVerifier { .0 .into_iter() .collect::>()?; + println!("DONE"); // Answer FRI queries. - let samples = sampled_points + let samples = sampled_points // Sample point is always the same and the value is the one provided in the proof .zip_cols(proof.sampled_values) .map_cols(|(sampled_points, sampled_values)| { zip(sampled_points, sampled_values) diff --git a/Stwo_wrapper/crates/prover/src/core/prover/mod.rs b/Stwo_wrapper/crates/prover/src/core/prover/mod.rs index ce414aa..30493fc 100644 --- a/Stwo_wrapper/crates/prover/src/core/prover/mod.rs +++ b/Stwo_wrapper/crates/prover/src/core/prover/mod.rs @@ -118,7 +118,7 @@ pub fn verify( let composition_oods_eval = extract_composition_eval(sampled_oods_values).map_err(|_| { VerificationError::InvalidStructure("Unexpected sampled_values structure".to_string()) })?; - println!("composition_oods_eval = {:?}",composition_oods_eval); + if composition_oods_eval // Compute != components.eval_composition_polynomial_at_point( diff --git a/Stwo_wrapper/crates/prover/src/core/vcs/verifier.rs b/Stwo_wrapper/crates/prover/src/core/vcs/verifier.rs index 53346bb..08428de 100644 --- a/Stwo_wrapper/crates/prover/src/core/vcs/verifier.rs +++ b/Stwo_wrapper/crates/prover/src/core/vcs/verifier.rs @@ -1,6 +1,5 @@ use std::cmp::Reverse; use std::collections::BTreeMap; - use itertools::Itertools; use thiserror::Error; @@ -152,10 +151,8 @@ impl MerkleVerifier { if node_values.len() != n_columns_in_layer { return Err(MerkleVerificationError::WitnessTooShort); } - layer_total_queries.push((node_index, H::hash_node(node_hashes, &node_values))); } - if !layer_queried_values.iter().all(|(_, c)| c.is_empty()) { return Err(MerkleVerificationError::ColumnValuesTooLong); } diff --git a/Stwo_wrapper/crates/prover/src/examples/wide_fibonacci/mod.rs b/Stwo_wrapper/crates/prover/src/examples/wide_fibonacci/mod.rs index 50137b4..1ac82d0 100644 --- a/Stwo_wrapper/crates/prover/src/examples/wide_fibonacci/mod.rs +++ b/Stwo_wrapper/crates/prover/src/examples/wide_fibonacci/mod.rs @@ -191,7 +191,7 @@ pub fn pretty_save_poseidon_bls_proof(proof: &StarkProof