Struct snarkvm_algorithms::snark::groth16::KeypairAssembly
source · [−]pub struct KeypairAssembly<E: PairingEngine> {
pub num_public_variables: usize,
pub num_private_variables: usize,
pub at: Vec<Vec<(E::Fr, Index)>>,
pub bt: Vec<Vec<(E::Fr, Index)>>,
pub ct: Vec<Vec<(E::Fr, Index)>>,
}
Expand description
This is our assembly structure that we’ll use to synthesize the circuit into a QAP.
Fields
num_public_variables: usize
num_private_variables: usize
at: Vec<Vec<(E::Fr, Index)>>
bt: Vec<Vec<(E::Fr, Index)>>
ct: Vec<Vec<(E::Fr, Index)>>
Trait Implementations
sourceimpl<E: PairingEngine> CanonicalDeserialize for KeypairAssembly<E>
impl<E: PairingEngine> CanonicalDeserialize for KeypairAssembly<E>
sourcefn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
fn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
Reads Self
from reader
.
sourcefn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
fn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
Reads Self
from reader
without compression.
sourceimpl<E: PairingEngine> CanonicalSerialize for KeypairAssembly<E>
impl<E: PairingEngine> CanonicalSerialize for KeypairAssembly<E>
sourcefn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
Serializes self
into writer
.
fn serialized_size(&self) -> usize
sourcefn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
fn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
Serializes self
into writer
without compression.
fn uncompressed_size(&self) -> usize
sourceimpl<E: Clone + PairingEngine> Clone for KeypairAssembly<E> where
E::Fr: Clone,
E::Fr: Clone,
E::Fr: Clone,
impl<E: Clone + PairingEngine> Clone for KeypairAssembly<E> where
E::Fr: Clone,
E::Fr: Clone,
E::Fr: Clone,
sourcefn clone(&self) -> KeypairAssembly<E>
fn clone(&self) -> KeypairAssembly<E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<E: PairingEngine> ConstraintSystem<<E as PairingEngine>::Fr> for KeypairAssembly<E>
impl<E: PairingEngine> ConstraintSystem<<E as PairingEngine>::Fr> for KeypairAssembly<E>
type Root = Self
type Root = Self
Represents the type of the “root” of this constraint system so that nested namespaces can minimize indirection. Read more
sourcefn alloc<F, A, AR>(&mut self, _: A, _: F) -> Result<Variable, SynthesisError> where
F: FnOnce() -> Result<E::Fr, SynthesisError>,
A: FnOnce() -> AR,
AR: AsRef<str>,
fn alloc<F, A, AR>(&mut self, _: A, _: F) -> Result<Variable, SynthesisError> where
F: FnOnce() -> Result<E::Fr, SynthesisError>,
A: FnOnce() -> AR,
AR: AsRef<str>,
Allocate a private variable in the constraint system. The provided
function is used to determine the assignment of the variable. The
given annotation
function is invoked in testing contexts in order
to derive a unique name for this variable in the current namespace. Read more
sourcefn alloc_input<F, A, AR>(
&mut self,
_: A,
_: F
) -> Result<Variable, SynthesisError> where
F: FnOnce() -> Result<E::Fr, SynthesisError>,
A: FnOnce() -> AR,
AR: AsRef<str>,
fn alloc_input<F, A, AR>(
&mut self,
_: A,
_: F
) -> Result<Variable, SynthesisError> where
F: FnOnce() -> Result<E::Fr, SynthesisError>,
A: FnOnce() -> AR,
AR: AsRef<str>,
Allocate a public variable in the constraint system. The provided function is used to determine the assignment of the variable. Read more
sourcefn enforce<A, AR, LA, LB, LC>(&mut self, _: A, a: LA, b: LB, c: LC) where
A: FnOnce() -> AR,
AR: AsRef<str>,
LA: FnOnce(LinearCombination<E::Fr>) -> LinearCombination<E::Fr>,
LB: FnOnce(LinearCombination<E::Fr>) -> LinearCombination<E::Fr>,
LC: FnOnce(LinearCombination<E::Fr>) -> LinearCombination<E::Fr>,
fn enforce<A, AR, LA, LB, LC>(&mut self, _: A, a: LA, b: LB, c: LC) where
A: FnOnce() -> AR,
AR: AsRef<str>,
LA: FnOnce(LinearCombination<E::Fr>) -> LinearCombination<E::Fr>,
LB: FnOnce(LinearCombination<E::Fr>) -> LinearCombination<E::Fr>,
LC: FnOnce(LinearCombination<E::Fr>) -> LinearCombination<E::Fr>,
Enforce that A
* B
= C
. The annotation
function is invoked in
testing contexts in order to derive a unique name for the constraint
in the current namespace. Read more
sourcefn push_namespace<NR, N>(&mut self, _: N) where
NR: AsRef<str>,
N: FnOnce() -> NR,
fn push_namespace<NR, N>(&mut self, _: N) where
NR: AsRef<str>,
N: FnOnce() -> NR,
Create a new (sub)namespace and enter into it. Not intended
for downstream use; use namespace
instead. Read more
sourcefn pop_namespace(&mut self)
fn pop_namespace(&mut self)
Exit out of the existing namespace. Not intended for
downstream use; use namespace
instead. Read more
sourcefn get_root(&mut self) -> &mut Self::Root
fn get_root(&mut self) -> &mut Self::Root
Gets the “root” constraint system, bypassing the namespacing.
Not intended for downstream use; use namespace
instead. Read more
sourcefn num_constraints(&self) -> usize
fn num_constraints(&self) -> usize
Output the number of constraints in the system.
sourcefn num_public_variables(&self) -> usize
fn num_public_variables(&self) -> usize
Output the number of public input variables to the system.
sourcefn num_private_variables(&self) -> usize
fn num_private_variables(&self) -> usize
Output the number of private input variables to the system.
sourcefn is_in_setup_mode(&self) -> bool
fn is_in_setup_mode(&self) -> bool
Output whether the constraint system is in the setup mode.
Auto Trait Implementations
impl<E> RefUnwindSafe for KeypairAssembly<E> where
<E as PairingEngine>::Fr: RefUnwindSafe,
impl<E> Send for KeypairAssembly<E>
impl<E> Sync for KeypairAssembly<E>
impl<E> Unpin for KeypairAssembly<E> where
<E as PairingEngine>::Fr: Unpin,
impl<E> UnwindSafe for KeypairAssembly<E> where
<E as PairingEngine>::Fr: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more