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
… constraint
  • Loading branch information
han0110 committed Aug 28, 2023
1 parent fe71cd4 commit 52d719c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions halo2_proofs/src/plonk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,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 @@ -188,7 +185,10 @@ where
permutation: permutation::VerifyingKey<C>,
cs: ConstraintSystem<C::Scalar>,
selectors: Vec<Vec<bool>>,
) -> Self {
) -> Self
where
C::ScalarExt: FromUniformBytes<64>,
{
// Compute cached values.
let cs_degree = cs.degree();

Expand Down Expand Up @@ -256,6 +256,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 52d719c

Please sign in to comment.