arnaucube
arnaucube/testudoPublic Self-hosted repository
testudo/src/transcript.rs
src/transcript.rsRaw
 1use ark_ff::PrimeField;
 2use ark_serialize::CanonicalSerialize;
 3/// Transcript is the application level transcript to derive the challenges
 4/// needed for Fiat Shamir during aggregation. It is given to the
 5/// prover/verifier so that the transcript can be fed with any other data first.
 6/// TODO: Make this trait the only Transcript trait
 7pub trait Transcript {
 8  fn domain_sep(&mut self);
 9  fn append<S: CanonicalSerialize>(&mut self, label: &'static [u8], point: &S);
10  fn challenge_scalar<F: PrimeField>(&mut self, label: &'static [u8]) -> F;
11  fn challenge_scalar_vec<F: PrimeField>(&mut self, label: &'static [u8], n: usize) -> Vec<F> {
12    (0..n).map(|_| self.challenge_scalar(label)).collect()
13  }
14}
15
16pub use crate::poseidon_transcript::TranscriptWriter;