Skip to main content

Transcript

Struct Transcript 

Source
pub struct Transcript<H: Hasher = DefaultHasher> { /* private fields */ }
Expand description

Fiat-Shamir transcript as a continuous hash chain: inputs update the running state; challenges are produced by finalizing a clone and re-absorbing the digest so each squeeze depends on every prior op.

Generic over H so SHA3 / Blake3 / Poseidon backends are interchangeable.

Implementations§

Source§

impl<H: Hasher> Transcript<H>

Source

pub fn new(label: &'static [u8]) -> Self

Create a new transcript with a domain separator.

Source

pub fn append_message(&mut self, label: &'static [u8], message: &[u8])

Append labelled bytes. The length prefix is required to block length-extension collisions between messages.

Source

pub fn append_u64(&mut self, label: &'static [u8], value: u64)

Append a u64 for protocol context (num_rows, num_cols, bus heights, …).

Source

pub fn append_field<F: TowerField>(&mut self, label: &'static [u8], element: F)

Source

pub fn append_field_list<F: TowerField>( &mut self, label: &'static [u8], elements: &[F], )

Append a list of field elements (e.g. a polynomial’s round coefficients). Length-prefixed and serialized via TowerField::to_bytes() for canonical, padding-free, endian-agnostic hashing.

Source

pub fn challenge_field<F: TowerField>( &mut self, label: &'static [u8], ) -> Result<F>

Draw a field challenge via the wide-pipe Fiat-Shamir pattern: finalize a clone of the running hasher (preserving full internal entropy), then re-absorb the digest so the next challenge depends on this one.

Trait Implementations§

Source§

impl<H: Clone + Hasher> Clone for Transcript<H>

Source§

fn clone(&self) -> Transcript<H>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<H: Debug + Hasher> Debug for Transcript<H>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<H> Freeze for Transcript<H>
where H: Freeze,

§

impl<H> RefUnwindSafe for Transcript<H>
where H: RefUnwindSafe,

§

impl<H> Send for Transcript<H>

§

impl<H> Sync for Transcript<H>

§

impl<H> Unpin for Transcript<H>
where H: Unpin,

§

impl<H> UnsafeUnpin for Transcript<H>
where H: UnsafeUnpin,

§

impl<H> UnwindSafe for Transcript<H>
where H: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.