Skip to main content

dory_pcs/primitives/
transcript.rs

1//! Transcript trait for Fiat-Shamir transformations
2
3#![allow(missing_docs)]
4
5use crate::primitives::arithmetic::{Group, PairingCurve};
6use crate::primitives::DorySerialize;
7
8/// Transcript to standardize fiat shamir across different transcript impleemntations
9pub trait Transcript {
10    type Curve: PairingCurve;
11    fn append_bytes(&mut self, label: &[u8], bytes: &[u8]);
12
13    fn append_field(
14        &mut self,
15        label: &[u8],
16        x: &<<Self::Curve as PairingCurve>::G1 as Group>::Scalar,
17    );
18
19    fn append_group<G: Group>(&mut self, label: &[u8], g: &G);
20
21    fn append_serde<S: DorySerialize>(&mut self, label: &[u8], s: &S);
22
23    fn challenge_scalar(
24        &mut self,
25        label: &[u8],
26    ) -> <<Self::Curve as PairingCurve>::G1 as Group>::Scalar;
27
28    fn reset(&mut self, domain_label: &[u8]);
29}