pub trait ECTranscriptTrait<C: PrimeOrderCurve>: Display {
// Required methods
fn append_ec_point(&mut self, label: &str, elem: C);
fn append_ec_points(&mut self, label: &str, elements: &[C]);
fn append_scalar_field_elem(&mut self, label: &str, elem: C::Scalar);
fn append_scalar_field_elems(&mut self, label: &str, elements: &[C::Scalar]);
fn append_input_ec_points(&mut self, label: &str, elements: Vec<C>);
fn append_input_scalar_field_elems(
&mut self,
label: &str,
elements: &[C::Scalar],
);
fn append_base_field_elems(&mut self, label: &str, elements: &[C::Base]);
fn get_scalar_field_challenge(&mut self, label: &str) -> C::Scalar;
fn get_scalar_field_challenges(
&mut self,
label: &str,
num_elements: usize,
) -> Vec<C::Scalar>;
fn get_ec_challenge(&mut self, label: &str) -> C;
fn get_ec_challenges(&mut self, label: &str, num_elements: usize) -> Vec<C>;
}Expand description
The purposes of this trait is simply to hide (i.e. abstract away) the generic for the sponge type from the prover and verifier code.
Required Methods§
fn append_ec_point(&mut self, label: &str, elem: C)
fn append_ec_points(&mut self, label: &str, elements: &[C])
fn append_scalar_field_elem(&mut self, label: &str, elem: C::Scalar)
fn append_scalar_field_elems(&mut self, label: &str, elements: &[C::Scalar])
Sourcefn append_input_ec_points(&mut self, label: &str, elements: Vec<C>)
fn append_input_ec_points(&mut self, label: &str, elements: Vec<C>)
This function absorbs elliptic curve points as individual base field elements, and additionally absorbs the hash chain digest of the base field elements.
Sourcefn append_input_scalar_field_elems(
&mut self,
label: &str,
elements: &[C::Scalar],
)
fn append_input_scalar_field_elems( &mut self, label: &str, elements: &[C::Scalar], )
This function absorbs scalar field elements into the transcript sponge, and additionally absorbs the hash chain digest of these elements.
Sourcefn append_base_field_elems(&mut self, label: &str, elements: &[C::Base])
fn append_base_field_elems(&mut self, label: &str, elements: &[C::Base])
This function absorbs base field elements into the transcript sponge.