Struct acvm_blackbox_solver::BigIntSolver
source · pub struct BigIntSolver { /* private fields */ }
Expand description
Resolve BigInt opcodes by storing BigInt values (and their moduli) by their ID in a HashMap:
- When it encounters a bigint operation opcode, it performs the operation on the stored values and store the result using the provided ID.
- When it gets a to_bytes opcode, it simply looks up the value and resolves the output witness accordingly.
Implementations§
source§impl BigIntSolver
impl BigIntSolver
pub fn bigint_from_bytes( &mut self, inputs: &[u8], modulus: &[u8], output: u32 ) -> Result<(), BlackBoxResolutionError>
pub fn bigint_to_bytes( &self, input: u32 ) -> Result<Vec<u8>, BlackBoxResolutionError>
pub fn bigint_op( &mut self, lhs: u32, rhs: u32, output: u32, func: BlackBoxFunc ) -> Result<(), BlackBoxResolutionError>
Trait Implementations§
source§impl Clone for BigIntSolver
impl Clone for BigIntSolver
source§fn clone(&self) -> BigIntSolver
fn clone(&self) -> BigIntSolver
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BigIntSolver
impl Debug for BigIntSolver
source§impl Default for BigIntSolver
impl Default for BigIntSolver
source§fn default() -> BigIntSolver
fn default() -> BigIntSolver
Returns the “default value” for a type. Read more
source§impl PartialEq for BigIntSolver
impl PartialEq for BigIntSolver
source§fn eq(&self, other: &BigIntSolver) -> bool
fn eq(&self, other: &BigIntSolver) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for BigIntSolver
impl StructuralPartialEq for BigIntSolver
Auto Trait Implementations§
impl Freeze for BigIntSolver
impl RefUnwindSafe for BigIntSolver
impl Send for BigIntSolver
impl Sync for BigIntSolver
impl Unpin for BigIntSolver
impl UnwindSafe for BigIntSolver
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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