-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pre/post image col consistent checking
- Loading branch information
Showing
5 changed files
with
64 additions
and
38 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use halo2_proofs::pairing::bn256::Bn256; | ||
use halo2_proofs::pairing::bn256::G1Affine; | ||
use halo2_proofs::plonk::get_advice_commitments_from_transcript; | ||
use halo2_proofs::plonk::VerifyingKey; | ||
use halo2aggregator_s::transcript::poseidon::PoseidonRead; | ||
|
||
pub fn get_named_advice_commitment( | ||
vkey: &VerifyingKey<G1Affine>, | ||
proof: &Vec<u8>, | ||
named_advice: &str, | ||
) -> G1Affine { | ||
let img_col_idx = vkey | ||
.cs | ||
.named_advices | ||
.iter() | ||
.find(|(k, _)| k == named_advice) | ||
.unwrap() | ||
.1; | ||
|
||
get_advice_commitments_from_transcript::<Bn256, _, _>(vkey, &mut PoseidonRead::init(&proof[..])) | ||
.unwrap()[img_col_idx as usize] | ||
} |