Skip to main content

ZincPlusPiop

Struct ZincPlusPiop 

Source
pub struct ZincPlusPiop<Zt, U, F, const DEGREE_PLUS_ONE: usize>(/* private fields */)
where
    Zt: ZincTypes<DEGREE_PLUS_ONE>,
    U: Uair,
    F: PrimeField;
Expand description

Main struct for the Zinc+ PIOP. The protocol is implemented as associated functions on it.

(Note that type parameters are further constrained in the impl blocks for the prover and verifier)

Implementations§

Source§

impl<Zt, U, F, const D: usize> ZincPlusPiop<Zt, U, F, D>
where Zt: ZincTypes<D>, U: Uair, F: PrimeField, F::Inner: ConstTranscribable,

Source

pub fn step0_commit<'a>( (pp_bin, pp_arb, pp_int): &'a (ZipPlusParams<Zt::BinaryZt, Zt::BinaryLc>, ZipPlusParams<Zt::ArbitraryZt, Zt::ArbitraryLc>, ZipPlusParams<Zt::IntZt, Zt::IntLc>), trace: &'a UairTrace<'static, Zt::Int, Zt::Int, D>, num_vars: usize, ) -> Result<ProverBase<'a, Zt, U, F, D>, ProtocolError<F, U::Ideal>>

Step 0: Prover entry point. Commit witness columns via Zip+ PCS, absorb roots and public data into the Fiat-Shamir transcript.

Source§

impl<Zt, U, F, const D: usize> ZincPlusPiop<Zt, U, F, D>
where Zt: ZincTypes<D>, Zt::Int: ProjectableToField<F>, <Zt::ArbitraryZt as ZipTypes>::Eval: ProjectableToField<F>, F: InnerTransparentField + FromPrimitiveWithConfig + for<'a> FromWithConfig<&'a Zt::Int> + for<'a> FromWithConfig<&'a Zt::CombR> + for<'a> FromWithConfig<&'a Zt::Chal> + for<'a> FromWithConfig<&'a Zt::Pt> + for<'a> MulByScalar<&'a F> + FromRef<F> + Send + Sync + 'static, F::Inner: ConstIntSemiring + ConstTranscribable + FromRef<Zt::Fmod> + Send + Sync + Zero + Default, F::Modulus: ConstTranscribable + FromRef<Zt::Fmod>, U: Uair + 'static,

Source

pub fn prove<const MLE_FIRST: bool, const CHECK_FOR_OVERFLOW: bool>( pp: &(ZipPlusParams<Zt::BinaryZt, Zt::BinaryLc>, ZipPlusParams<Zt::ArbitraryZt, Zt::ArbitraryLc>, ZipPlusParams<Zt::IntZt, Zt::IntLc>), trace: &UairTrace<'static, Zt::Int, Zt::Int, D>, num_vars: usize, project_scalar: impl Fn(&U::Scalar, &F::Config) -> DynamicPolynomialF<F>, ) -> Result<Proof<F>, ProtocolError<F, U::Ideal>>

Zinc+ full PIOP prover.

Runs all protocol steps in sequence and returns the assembled proof. For per-step control, start with Self::step0_commit and chain the individual stepN_* methods.

Source§

impl<Zt, U, F, const D: usize> ZincPlusPiop<Zt, U, F, D>
where Zt: ZincTypes<D>, U: Uair, F: PrimeField, F::Inner: ConstTranscribable,

Source

pub fn step0_reconstruct_transcript<'a, IdealOverF>( (vp_bin, vp_arb, vp_int): &'a (ZipPlusParams<Zt::BinaryZt, Zt::BinaryLc>, ZipPlusParams<Zt::ArbitraryZt, Zt::ArbitraryLc>, ZipPlusParams<Zt::IntZt, Zt::IntLc>), proof: Proof<F>, public_trace: &'a UairTrace<'a, Zt::Int, Zt::Int, D>, num_vars: usize, ) -> Result<VerifierTranscriptReconstructed<'a, Zt, U, F, IdealOverF, D>, ProtocolError<F, IdealOverF>>
where IdealOverF: Ideal,

Step 0: Verifier entry point. Reconstruct Fiat-Shamir transcript from commitments and public data.

Source§

impl<Zt, U, F, const D: usize> ZincPlusPiop<Zt, U, F, D>
where Zt: ZincTypes<D>, Zt::Int: ProjectableToField<F>, <Zt::BinaryZt as ZipTypes>::Cw: ProjectableToField<F>, <Zt::ArbitraryZt as ZipTypes>::Eval: ProjectableToField<F>, <Zt::ArbitraryZt as ZipTypes>::Cw: ProjectableToField<F>, <Zt::IntZt as ZipTypes>::Cw: ProjectableToField<F>, F: InnerTransparentField + FromPrimitiveWithConfig + for<'a> FromWithConfig<&'a Zt::Int> + for<'a> FromWithConfig<&'a Zt::CombR> + for<'a> FromWithConfig<&'a Zt::Chal> + for<'a> MulByScalar<&'a F> + FromRef<F> + Send + Sync + 'static, F::Inner: ConstIntSemiring + ConstTranscribable + Send + Sync + Zero + Default, F::Modulus: ConstTranscribable + FromRef<Zt::Fmod>, U: Uair + 'static,

Source

pub fn verify<IdealOverF, const CHECK_FOR_OVERFLOW: bool>( vp: &(ZipPlusParams<Zt::BinaryZt, Zt::BinaryLc>, ZipPlusParams<Zt::ArbitraryZt, Zt::ArbitraryLc>, ZipPlusParams<Zt::IntZt, Zt::IntLc>), proof: Proof<F>, public_trace: &UairTrace<'_, Zt::Int, Zt::Int, D>, num_vars: usize, project_scalar: impl Fn(&U::Scalar, &F::Config) -> DynamicPolynomialF<F>, project_ideal: impl Fn(&IdealOrZero<U::Ideal>, &F::Config) -> IdealOverF, ) -> Result<(), ProtocolError<F, IdealOverF>>
where IdealOverF: Ideal + IdealCheck<DynamicPolynomialF<F>>,

Zinc+ full PIOP verifier.

Runs all verification steps in sequence and returns Ok(()) on success. For per-step control, starts with Self::step0_reconstruct_transcript and chain the individual stepN_* methods.

Trait Implementations§

Source§

impl<Zt, U, F, const DEGREE_PLUS_ONE: usize> Clone for ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>
where Zt: ZincTypes<DEGREE_PLUS_ONE> + Clone, U: Uair + Clone, F: PrimeField + Clone,

Source§

fn clone(&self) -> ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<Zt, U, F, const DEGREE_PLUS_ONE: usize> Debug for ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>
where Zt: ZincTypes<DEGREE_PLUS_ONE> + Debug, U: Uair + Debug, F: PrimeField + Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<Zt, U, F, const DEGREE_PLUS_ONE: usize> Default for ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>
where Zt: ZincTypes<DEGREE_PLUS_ONE> + Default, U: Uair + Default, F: PrimeField + Default,

Source§

fn default() -> ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>

Returns the “default value” for a type. Read more
Source§

impl<Zt, U, F, const DEGREE_PLUS_ONE: usize> Copy for ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>
where Zt: ZincTypes<DEGREE_PLUS_ONE> + Copy, U: Uair + Copy, F: PrimeField + Copy,

Auto Trait Implementations§

§

impl<Zt, U, F, const DEGREE_PLUS_ONE: usize> Freeze for ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>

§

impl<Zt, U, F, const DEGREE_PLUS_ONE: usize> RefUnwindSafe for ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>

§

impl<Zt, U, F, const DEGREE_PLUS_ONE: usize> Send for ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>
where Zt: Send, U: Send,

§

impl<Zt, U, F, const DEGREE_PLUS_ONE: usize> Sync for ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>
where Zt: Sync, U: Sync,

§

impl<Zt, U, F, const DEGREE_PLUS_ONE: usize> Unpin for ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>
where Zt: Unpin, U: Unpin, F: Unpin,

§

impl<Zt, U, F, const DEGREE_PLUS_ONE: usize> UnsafeUnpin for ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>

§

impl<Zt, U, F, const DEGREE_PLUS_ONE: usize> UnwindSafe for ZincPlusPiop<Zt, U, F, DEGREE_PLUS_ONE>
where Zt: UnwindSafe, U: UnwindSafe, F: 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
§

impl<T> AsMaybeUninit for T

§

type Uninit = MaybeUninit<T>

This type in its maybe-uninitialized form.
§

type SizedPart = T

The largest Sized element in Self, used to check for the absence of drop glue via a Copy bound. Read more
§

fn as_ref_uninit(&self) -> &<T as AsMaybeUninit>::Uninit

Converts a &self to its maybe-initialized equivalent.
§

unsafe fn as_mut_uninit(&mut self) -> &mut <T as AsMaybeUninit>::Uninit

Converts a &mut T to its maybe-initialized equivalent. Read more
§

unsafe fn raw_as_uninit<'a>(raw: *const T) -> &'a <T as AsMaybeUninit>::Uninit

Converts a raw pointer to a reference to maybe-uninit. Read more
§

unsafe fn raw_mut_as_uninit<'a>( raw: *mut T, ) -> &'a mut <T as AsMaybeUninit>::Uninit

Converts a raw mutable pointer to a mutable reference to maybe-uninit. Read more
§

impl<T> AsOut<T> for T
where T: Copy,

§

fn as_out<'out>(&'out mut self) -> Out<'out, T>

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
§

impl<F, T> IntoWithConfig<F> for T
where F: PrimeField + FromWithConfig<T>,

§

fn into_with_cfg(self, cfg: &<F as PrimeField>::Config) -> F

§

impl<T> ManuallyDropMut for T

§

type Ret = ManuallyDrop<T>

§

fn manually_drop_mut<'__>(&'__ mut self) -> &'__ mut ManuallyDrop<T>

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V