Skip to main content

Transcript

Trait Transcript 

Source
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§

Source

fn get_challenge<T: ConstTranscribable>(&mut self) -> T

Generates a pseudorandom transcribable value as a challenge based on the current transcript state, updating it.

Source

fn get_prime<R: ConstIntSemiring + ConstTranscribable, T: PrimalityTest<R>>( &mut self, ) -> R

Source

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§

Source

fn get_field_challenge<C>(&mut self, cfg: &C) -> C::Element
where C: FieldConfig + ProjectElementWithConfig<C::Integer>, C::Integer: ConstTranscribable,

Source

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.

Source

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.

Source

fn get_random_field_cfg<C, FMod, T>(&mut self) -> C
where C: BaseFieldConfig, C::Integer: FromRef<FMod>, FMod: ConstTranscribable + ConstIntSemiring, T: PrimalityTest<FMod>,

Source

fn absorb_bytes(&mut self, buf: &[u8])

Absorbs a byte slice into the transcript, delimited by domain-separation tags.

Source

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.

Source

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.

Source

fn absorb_int<S>(&mut self, v: &S, buf: &mut [u8])
where S: Semiring + Transcribable,

Absorbs an integer into the transcript.

Source

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.

Implementors§