Skip to main content

IOPProver

Struct IOPProver 

Source
pub struct IOPProver<F: Field> { /* private fields */ }
Expand description

IOP prover for a particular constraint system.

This struct encapsulates the constraint system and pre-computed wiring transpose, providing the core proving logic independent of the specific IOP compilation strategy. Most users should use Prover instead, which wraps this with a BaseFold compiler.

Implementations§

Source§

impl<F: Field> IOPProver<F>

Source

pub fn new(constraint_system: ConstraintSystemPadded<F>) -> Self

Constructs an IOP prover for a constraint system.

Source

pub const fn constraint_system(&self) -> &ConstraintSystemPadded<F>

Source

pub fn commit_precommit<P, Channel, A>( &self, witness: &Witness<F>, rng: &mut impl CryptoRng, channel: &mut Channel, alloc: &A, ) -> (Channel::Oracle, FieldVec<P, A>)
where F: BinaryField, P: PackedField<Scalar = F>, Channel: IOPProverChannel<P, A>, A: Allocator,

Packs and commits the precommit segment of a witness on the channel.

This must be called before Self::prove, and the returned oracle handle and packed buffer must be passed into prove. Callers that wrap the IOP (e.g. the ZK wrapper) can invoke this separately so the precommit oracle handle is available before the rest of the protocol runs.

Source

pub fn prove<P, Channel, A>( &self, witness: &Witness<F>, precommit_oracle: Channel::Oracle, precommit_packed: FieldVec<P, A>, rng: impl CryptoRng, channel: &mut Channel, alloc: &A, ) -> Result<(), Error>
where F: BinaryField, P: PackedField<Scalar = F>, Channel: IOPProverChannel<P, A>, A: Allocator,

Proves using an IOP channel interface.

This is the core proving logic, independent of the specific IOP compilation strategy. For most users, Prover::prove is the simpler interface.

§Arguments
  • witness - The witness values for the constraint system
  • precommit_oracle - Oracle handle obtained from Self::commit_precommit
  • precommit_packed - Packed precommit buffer obtained from Self::commit_precommit
  • rng - Random number generator for blinding
  • channel - The IOP prover channel (public input must be observed on transcript before creating the channel; the precommit oracle must already have been committed on it via Self::commit_precommit)

Trait Implementations§

Source§

impl<F: Debug + Field> Debug for IOPProver<F>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<F> Freeze for IOPProver<F>

§

impl<F> RefUnwindSafe for IOPProver<F>
where F: RefUnwindSafe,

§

impl<F> Send for IOPProver<F>

§

impl<F> Sync for IOPProver<F>

§

impl<F> Unpin for IOPProver<F>
where F: Unpin,

§

impl<F> UnsafeUnpin for IOPProver<F>

§

impl<F> UnwindSafe for IOPProver<F>
where 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
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<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, 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<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more