pub trait Transcript {
// Required methods
fn get_challenge<T: ConstTranscribable>(&mut self) -> T;
fn get_prime<R: ConstIntSemiring + ConstTranscribable, T: PrimalityTest<R>>(
&mut self,
) -> R;
fn absorb_inner(&mut self, v: &[u8]);
// Provided methods
fn get_field_challenge<C>(&mut self, cfg: &C) -> C::Element
where C: FieldConfig + ProjectElementWithConfig<C::Integer>,
C::Integer: ConstTranscribable { ... }
fn get_field_challenges<C>(&mut self, n: usize, cfg: &C) -> Vec<C::Element>
where C: FieldConfig + ProjectElementWithConfig<C::Integer>,
C::Integer: ConstTranscribable { ... }
fn get_challenges<T: ConstTranscribable>(&mut self, n: usize) -> Vec<T> { ... }
fn get_random_field_cfg<C, FMod, T>(&mut self) -> C
where C: BaseFieldConfig,
C::Integer: FromRef<FMod>,
FMod: ConstTranscribable + ConstIntSemiring,
T: PrimalityTest<FMod> { ... }
fn absorb_bytes(&mut self, buf: &[u8]) { ... }
fn absorb_field_element<C, I>(
&mut self,
cfg: &C,
v: &C::Element,
buf: &mut [u8],
)
where C: FieldConfig + LiftElementWithConfig<I>,
I: Semiring + Transcribable { ... }
fn absorb_field_element_slice<C, I>(
&mut self,
cfg: &C,
v: &[C::Element],
buf: &mut [u8],
)
where C: FieldConfig + LiftElementWithConfig<I>,
I: Semiring + Transcribable { ... }
fn absorb_int<S>(&mut self, v: &S, buf: &mut [u8])
where S: Semiring + Transcribable { ... }
fn absorb_int_slice<S>(&mut self, v: &[S], buf: &mut [u8])
where S: Semiring + Transcribable { ... }
}Required Methods§
Sourcefn get_challenge<T: ConstTranscribable>(&mut self) -> T
fn get_challenge<T: ConstTranscribable>(&mut self) -> T
Generates a pseudorandom transcribable value as a challenge based on the current transcript state, updating it.
fn get_prime<R: ConstIntSemiring + ConstTranscribable, T: PrimalityTest<R>>( &mut self, ) -> R
Sourcefn absorb_inner(&mut self, v: &[u8])
fn absorb_inner(&mut self, v: &[u8])
Absorbs a byte slice into the hash sponge. This updates the internal state of the hasher with the provided data. Should not be used directly.
Provided Methods§
fn get_field_challenge<C>(&mut self, cfg: &C) -> C::Elementwhere
C: FieldConfig + ProjectElementWithConfig<C::Integer>,
C::Integer: ConstTranscribable,
Sourcefn get_field_challenges<C>(&mut self, n: usize, cfg: &C) -> Vec<C::Element>where
C: FieldConfig + ProjectElementWithConfig<C::Integer>,
C::Integer: ConstTranscribable,
fn get_field_challenges<C>(&mut self, n: usize, cfg: &C) -> Vec<C::Element>where
C: FieldConfig + ProjectElementWithConfig<C::Integer>,
C::Integer: ConstTranscribable,
Generates a pseudorandom transcribable values as challenges based on the current transcript state, updating it.
Sourcefn get_challenges<T: ConstTranscribable>(&mut self, n: usize) -> Vec<T>
fn get_challenges<T: ConstTranscribable>(&mut self, n: usize) -> Vec<T>
Generates a pseudorandom transcribable values as challenges based on the current transcript state, updating it.
fn get_random_field_cfg<C, FMod, T>(&mut self) -> Cwhere
C: BaseFieldConfig,
C::Integer: FromRef<FMod>,
FMod: ConstTranscribable + ConstIntSemiring,
T: PrimalityTest<FMod>,
Sourcefn absorb_bytes(&mut self, buf: &[u8])
fn absorb_bytes(&mut self, buf: &[u8])
Absorbs a byte slice into the transcript, delimited by domain-separation tags.
Sourcefn absorb_field_element<C, I>(
&mut self,
cfg: &C,
v: &C::Element,
buf: &mut [u8],
)where
C: FieldConfig + LiftElementWithConfig<I>,
I: Semiring + Transcribable,
fn absorb_field_element<C, I>(
&mut self,
cfg: &C,
v: &C::Element,
buf: &mut [u8],
)where
C: FieldConfig + LiftElementWithConfig<I>,
I: Semiring + Transcribable,
Absorbs a field element (its raw inner representation) into the transcript.
The field modulus is NOT absorbed here: it is bound into the transcript separately, when the field is sampled.
Sourcefn absorb_field_element_slice<C, I>(
&mut self,
cfg: &C,
v: &[C::Element],
buf: &mut [u8],
)where
C: FieldConfig + LiftElementWithConfig<I>,
I: Semiring + Transcribable,
fn absorb_field_element_slice<C, I>(
&mut self,
cfg: &C,
v: &[C::Element],
buf: &mut [u8],
)where
C: FieldConfig + LiftElementWithConfig<I>,
I: Semiring + Transcribable,
Absorbs a slice of field element into the transcript.
Sourcefn absorb_int<S>(&mut self, v: &S, buf: &mut [u8])where
S: Semiring + Transcribable,
fn absorb_int<S>(&mut self, v: &S, buf: &mut [u8])where
S: Semiring + Transcribable,
Absorbs an integer into the transcript.
Sourcefn absorb_int_slice<S>(&mut self, v: &[S], buf: &mut [u8])where
S: Semiring + Transcribable,
fn absorb_int_slice<S>(&mut self, v: &[S], buf: &mut [u8])where
S: Semiring + Transcribable,
Absorbs a slice of integer into the transcript.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.