pub type PoseidonTranscript<C, S> = PoseidonTranscript<C, NativeLoader, S, T, RATE, R_F, R_P>;
Expand description

PoseidonTranscript with hardcoded parameter with 128-bits security.

Aliased Type§

struct PoseidonTranscript<C, S> { /* private fields */ }

Implementations

§

impl<C, S, const T: usize, const RATE: usize, const R_F: usize, const R_P: usize> PoseidonTranscript<C, NativeLoader, S, T, RATE, R_F, R_P>
where C: CurveAffine, <C as PrimeCurveAffine>::Scalar: FromUniformBytes<64>,

pub fn new( stream: S ) -> PoseidonTranscript<C, NativeLoader, S, T, RATE, R_F, R_P>

Initialize [PoseidonTranscript] given readable or writeable stream for verifying or proving with NativeLoader.

pub fn from_spec( stream: S, spec: Spec<<C as PrimeCurveAffine>::Scalar, T, RATE> ) -> PoseidonTranscript<C, NativeLoader, S, T, RATE, R_F, R_P>

Initialize [PoseidonTranscript] from a precomputed spec of round constants and MDS matrix because computing the constants is expensive.

§

impl<C, W, const T: usize, const RATE: usize, const R_F: usize, const R_P: usize> PoseidonTranscript<C, NativeLoader, W, T, RATE, R_F, R_P>
where C: CurveAffine, W: Write,

pub fn stream_mut(&mut self) -> &mut W

Returns mutable stream.

pub fn finalize(self) -> W

Finalize transcript and returns stream.

Trait Implementations

§

impl<C, L, S, const T: usize, const RATE: usize, const R_F: usize, const R_P: usize> Debug for PoseidonTranscript<C, L, S, T, RATE, R_F, R_P>
where C: Debug + CurveAffine, L: Debug + Loader<C>, S: Debug, <C as PrimeCurveAffine>::Scalar: Debug,

§

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

Formats the value using the given formatter. Read more
§

impl<C, S, const T: usize, const RATE: usize, const R_F: usize, const R_P: usize> Transcript<C, ChallengeScalar<C>> for PoseidonTranscript<C, NativeLoader, S, T, RATE, R_F, R_P>
where C: CurveAffine, <C as PrimeCurveAffine>::Scalar: FromUniformBytes<64>,

§

fn squeeze_challenge(&mut self) -> ChallengeScalar<C>

Squeeze an encoded verifier challenge from the transcript.
§

fn common_point(&mut self, ec_point: C) -> Result<(), Error>

Writing the point to the transcript without writing it to the proof, treating it as a common input.
§

fn common_scalar( &mut self, scalar: <C as PrimeCurveAffine>::Scalar ) -> Result<(), Error>

Writing the scalar to the transcript without writing it to the proof, treating it as a common input.
§

fn squeeze_challenge_scalar<T>(&mut self) -> ChallengeScalar<C, T>

Squeeze a typed challenge (in the scalar field) from the transcript.
§

impl<C, S, const T: usize, const RATE: usize, const R_F: usize, const R_P: usize> Transcript<C, NativeLoader> for PoseidonTranscript<C, NativeLoader, S, T, RATE, R_F, R_P>
where C: CurveAffine, <C as PrimeCurveAffine>::Scalar: FromUniformBytes<64>,

§

fn loader(&self) -> &NativeLoader

Returns [Loader].
§

fn squeeze_challenge(&mut self) -> <C as PrimeCurveAffine>::Scalar

Squeeze a challenge.
§

fn common_scalar( &mut self, scalar: &<C as PrimeCurveAffine>::Scalar ) -> Result<(), Error>

Update with a scalar.
§

fn common_ec_point(&mut self, ec_point: &C) -> Result<(), Error>

Update with an elliptic curve point.
§

fn squeeze_n_challenges( &mut self, n: usize ) -> Vec<<L as ScalarLoader<<C as CurveAffine>::ScalarExt>>::LoadedScalar>

Squeeze n challenges.
§

impl<C, R, const T: usize, const RATE: usize, const R_F: usize, const R_P: usize> TranscriptRead<C, ChallengeScalar<C>> for PoseidonTranscript<C, NativeLoader, R, T, RATE, R_F, R_P>
where C: CurveAffine, <C as PrimeCurveAffine>::Scalar: FromUniformBytes<64>, R: Read,

§

fn read_point(&mut self) -> Result<C, Error>

Read a curve point from the prover.
§

fn read_scalar(&mut self) -> Result<<C as PrimeCurveAffine>::Scalar, Error>

Read a curve scalar from the prover.
§

impl<C, R, const T: usize, const RATE: usize, const R_F: usize, const R_P: usize> TranscriptRead<C, NativeLoader> for PoseidonTranscript<C, NativeLoader, R, T, RATE, R_F, R_P>
where C: CurveAffine, <C as PrimeCurveAffine>::Scalar: FromUniformBytes<64>, R: Read,

§

fn read_scalar(&mut self) -> Result<<C as PrimeCurveAffine>::Scalar, Error>

Read a scalar.
§

fn read_ec_point(&mut self) -> Result<C, Error>

Read a elliptic curve point.
§

fn read_n_scalars( &mut self, n: usize ) -> Result<Vec<<L as ScalarLoader<<C as CurveAffine>::ScalarExt>>::LoadedScalar>, Error>

Read n scalar.
§

fn read_n_ec_points( &mut self, n: usize ) -> Result<Vec<<L as EcPointLoader<C>>::LoadedEcPoint>, Error>

Read n elliptic curve point.
§

impl<C, R, const T: usize, const RATE: usize, const R_F: usize, const R_P: usize> TranscriptReadBuffer<R, C, ChallengeScalar<C>> for PoseidonTranscript<C, NativeLoader, R, T, RATE, R_F, R_P>
where C: CurveAffine, <C as PrimeCurveAffine>::Scalar: FromUniformBytes<64>, R: Read,

§

fn init(reader: R) -> PoseidonTranscript<C, NativeLoader, R, T, RATE, R_F, R_P>

Initialize a transcript given an input buffer.
§

impl<C, W, const T: usize, const RATE: usize, const R_F: usize, const R_P: usize> TranscriptWrite<C> for PoseidonTranscript<C, NativeLoader, W, T, RATE, R_F, R_P>
where C: CurveAffine, <C as PrimeCurveAffine>::Scalar: FromUniformBytes<64>, W: Write,

§

fn write_scalar( &mut self, scalar: <C as PrimeCurveAffine>::Scalar ) -> Result<(), Error>

Write a scalar.
§

fn write_ec_point(&mut self, ec_point: C) -> Result<(), Error>

Write a elliptic curve point.
§

impl<C, W, const T: usize, const RATE: usize, const R_F: usize, const R_P: usize> TranscriptWrite<C, ChallengeScalar<C>> for PoseidonTranscript<C, NativeLoader, W, T, RATE, R_F, R_P>
where C: CurveAffine, <C as PrimeCurveAffine>::Scalar: FromUniformBytes<64>, W: Write,

§

fn write_point(&mut self, ec_point: C) -> Result<(), Error>

Write a curve point to the proof and the transcript.
§

fn write_scalar( &mut self, scalar: <C as PrimeCurveAffine>::Scalar ) -> Result<(), Error>

Write a scalar to the proof and the transcript.
§

impl<C, W, const T: usize, const RATE: usize, const R_F: usize, const R_P: usize> TranscriptWriterBuffer<W, C, ChallengeScalar<C>> for PoseidonTranscript<C, NativeLoader, W, T, RATE, R_F, R_P>
where C: CurveAffine, <C as PrimeCurveAffine>::Scalar: FromUniformBytes<64>, W: Write,

§

fn init(writer: W) -> PoseidonTranscript<C, NativeLoader, W, T, RATE, R_F, R_P>

Initialize a transcript given an output buffer.
§

fn finalize(self) -> W

Conclude the interaction and return the output buffer (writer).