Skip to content

Commit

Permalink
feat: expose transcript_repr of VerifyingKey and reduce the trait…
Browse files Browse the repository at this point in the history
  • Loading branch information
han0110 authored and Velaciela committed Oct 9, 2023
1 parent 669a670 commit d19480a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions halo2_proofs/src/plonk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,7 @@ where
}
}

impl<C: CurveAffine> VerifyingKey<C>
where
C::ScalarExt: FromUniformBytes<64>,
{
impl<C: CurveAffine> VerifyingKey<C> {
fn bytes_length(&self) -> usize {
8 + (self.fixed_commitments.len() * C::default().to_bytes().as_ref().len())
+ self.permutation.bytes_length()
Expand All @@ -182,8 +179,11 @@ where
fixed_commitments: Vec<C>,
permutation: permutation::VerifyingKey<C>,
cs: ConstraintSystem<C::Scalar>,
//selectors: Vec<Vec<bool>>,
) -> Self {
// selectors: Vec<Vec<bool>>,
) -> Self
where
C::ScalarExt: FromUniformBytes<64>,
{
// Compute cached values.
let cs_degree = cs.degree();

Expand Down Expand Up @@ -251,6 +251,11 @@ where
pub fn cs(&self) -> &ConstraintSystem<C::Scalar> {
&self.cs
}

/// Returns representative of this `VerifyingKey` in transcripts
pub fn transcript_repr(&self) -> C::Scalar {
self.transcript_repr
}
}

/// Minimal representation of a verification key that can be used to identify
Expand Down

0 comments on commit d19480a

Please sign in to comment.