pub struct Circuit;

Trait Implementations§

source§

impl Clone for Circuit

source§

fn clone(&self) -> Circuit

Returns a copy 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 ConstraintSynthesizer<Fp256<FrParameters>> for Circuit

source§

fn generate_constraints<CS: ConstraintSystem<Fq>>( &self, cs: &mut CS ) -> Result<(), SynthesisError>

Synthesizes the constraints from the environment into a snarkvm_algorithms::r1cs-compliant constraint system.

source§

impl Debug for Circuit

source§

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

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

impl Display for Circuit

source§

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

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

impl Environment for Circuit

source§

fn zero() -> LinearCombination<Self::BaseField>

Returns the zero constant.

source§

fn one() -> LinearCombination<Self::BaseField>

Returns the one constant.

source§

fn new_variable(mode: Mode, value: Self::BaseField) -> Variable<Self::BaseField>

Returns a new variable of the given mode and value.

source§

fn new_witness<Fn: FnOnce() -> Output::Primitive, Output: Inject>( mode: Mode, logic: Fn ) -> Output

Returns a new witness of the given mode and value.

source§

fn scope<S: Into<String>, Fn, Output>(name: S, logic: Fn) -> Outputwhere Fn: FnOnce() -> Output,

Enters a new scope for the environment.

source§

fn enforce<Fn, A, B, C>(constraint: Fn)where Fn: FnOnce() -> (A, B, C), A: Into<LinearCombination<Self::BaseField>>, B: Into<LinearCombination<Self::BaseField>>, C: Into<LinearCombination<Self::BaseField>>,

Adds one constraint enforcing that (A * B) == C.

source§

fn is_satisfied() -> bool

Returns true if all constraints in the environment are satisfied.

source§

fn is_satisfied_in_scope() -> bool

Returns true if all constraints in the current scope are satisfied.

source§

fn num_constants() -> u64

Returns the number of constants in the entire circuit.

source§

fn num_public() -> u64

Returns the number of public variables in the entire circuit.

source§

fn num_private() -> u64

Returns the number of private variables in the entire circuit.

source§

fn num_constraints() -> u64

Returns the number of constraints in the entire circuit.

source§

fn num_nonzeros() -> (u64, u64, u64)

Returns the number of nonzeros in the entire circuit.

source§

fn num_constants_in_scope() -> u64

Returns the number of constants for the current scope.

source§

fn num_public_in_scope() -> u64

Returns the number of public variables for the current scope.

source§

fn num_private_in_scope() -> u64

Returns the number of private variables for the current scope.

source§

fn num_constraints_in_scope() -> u64

Returns the number of constraints for the current scope.

source§

fn num_nonzeros_in_scope() -> (u64, u64, u64)

Returns the number of nonzeros for the current scope.

source§

fn halt<S: Into<String>, T>(message: S) -> T

Halts the program from further synthesis, evaluation, and execution in the current environment.

source§

fn inject_r1cs(r1cs: R1CS<Self::BaseField>)

TODO (howardwu): Abstraction - Refactor this into an appropriate design. Circuits should not have easy access to this during synthesis. Returns the R1CS circuit, resetting the circuit.

source§

fn eject_r1cs_and_reset() -> R1CS<Self::BaseField>

TODO (howardwu): Abstraction - Refactor this into an appropriate design. Circuits should not have easy access to this during synthesis. Returns the R1CS circuit, resetting the circuit.

source§

fn eject_assignment_and_reset( ) -> Assignment<<Self::Network as Environment>::Field>

TODO (howardwu): Abstraction - Refactor this into an appropriate design. Circuits should not have easy access to this during synthesis. Returns the R1CS assignment of the circuit, resetting the circuit.

source§

fn reset()

Clears the circuit and initializes an empty environment.

§

type Affine = <Testnet3 as Environment>::Affine

§

type BaseField = <Testnet3 as Environment>::Field

§

type Network = Testnet3

§

type ScalarField = <Testnet3 as Environment>::Scalar

source§

const EDWARDS_A: Self::BaseField = <Self::Network as console::Environment>::EDWARDS_A

The coefficient A of the twisted Edwards curve.
source§

const EDWARDS_D: Self::BaseField = <Self::Network as console::Environment>::EDWARDS_D

The coefficient D of the twisted Edwards curve.
source§

const MONTGOMERY_A: Self::BaseField = <Self::Network as console::Environment>::MONTGOMERY_A

The coefficient A of the Montgomery curve.
source§

const MONTGOMERY_B: Self::BaseField = <Self::Network as console::Environment>::MONTGOMERY_B

The coefficient B of the Montgomery curve.
source§

const MAX_STRING_BYTES: u32 = <Self::Network as console::Environment>::MAX_STRING_BYTES

The maximum number of bytes allowed in a string.
source§

fn assert<Boolean: Into<LinearCombination<Self::BaseField>>>(boolean: Boolean)

Adds one constraint enforcing that the given boolean is true.
source§

fn assert_eq<A, B>(a: A, b: B)where A: Into<LinearCombination<Self::BaseField>>, B: Into<LinearCombination<Self::BaseField>>,

Adds one constraint enforcing that the A == B.
source§

fn assert_neq<A, B>(a: A, b: B)where A: Into<LinearCombination<Self::BaseField>>, B: Into<LinearCombination<Self::BaseField>>,

Adds one constraint enforcing that the A != B.
source§

fn count() -> (u64, u64, u64, u64, (u64, u64, u64))

Returns a tuple containing the number of constants, public variables, private variables, constraints, and nonzeros in the entire environment.
source§

fn count_in_scope() -> (u64, u64, u64, u64, (u64, u64, u64))

Returns a tuple containing the number of constants, public variables, private variables, constraints, and nonzeros for the current scope.
source§

impl Hash for Circuit

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<Circuit> for Circuit

source§

fn eq(&self, other: &Circuit) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Circuit

source§

impl Eq for Circuit

source§

impl StructuralEq for Circuit

source§

impl StructuralPartialEq for Circuit

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

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<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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 Twhere V: MultiLane<T>,

§

fn vzip(self) -> V