a generic Trait for both ml and uni KZG (#43)

This commit is contained in:
zhenfei
2022-07-21 13:01:49 -04:00
committed by GitHub
parent 43131a0afb
commit 17cff52765
13 changed files with 1872 additions and 950 deletions

View File

@@ -4,6 +4,7 @@
//! TODO(ZZ): decide which APIs need to be public.
use ark_ff::PrimeField;
use ark_serialize::CanonicalSerialize;
use merlin::Transcript;
use std::marker::PhantomData;
@@ -67,6 +68,15 @@ impl<F: PrimeField> IOPTranscript<F> {
self.append_message(label, &to_bytes!(field_elem)?)
}
// Append the message to the transcript.
pub fn append_serializable_element<S: CanonicalSerialize>(
&mut self,
label: &'static [u8],
group_elem: &S,
) -> Result<(), PolyIOPErrors> {
self.append_message(label, &to_bytes!(group_elem)?)
}
// Append a prover message to the transcript.
pub(crate) fn append_prover_message(
&mut self,