Struct ark_r1cs_std::groups::curves::short_weierstrass::ProjectiveVar [−][src]
pub struct ProjectiveVar<P: SWModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>, { pub x: F, pub y: F, pub z: F, // some fields omitted }
Expand description
An implementation of arithmetic for Short Weierstrass curves that relies on the complete formulae derived in the paper of [Renes, Costello, Batina 2015].
Fields
x: F
The x-coordinate.
y: F
The y-coordinate.
z: F
The z-coordinate.
Implementations
impl<P: SWModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> ProjectiveVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P: SWModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> ProjectiveVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
Convert this point into affine form.
pub fn new_variable_omit_on_curve_check(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<SWProjective<P>, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
pub fn new_variable_omit_on_curve_check(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<SWProjective<P>, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
Allocates a new variable without performing an on-curve check, which is useful if the variable is known to be on the curve (eg., if the point is a constant or is a public input).
Trait Implementations
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<&'a ProjectiveVar<P, F>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<&'a ProjectiveVar<P, F>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<&'a ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<&'a ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the +
operator.
Performs the +
operation. Read more
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<GroupProjective<P>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<GroupProjective<P>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the +
operator.
Performs the +
operation. Read more
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<GroupProjective<P>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<GroupProjective<P>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the +
operator.
Performs the +
operation. Read more
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<ProjectiveVar<P, F>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<ProjectiveVar<P, F>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the +
operator.
Performs the +
operation. Read more
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Add<ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the +
operator.
Performs the +
operation. Read more
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> AddAssign<&'a ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> AddAssign<&'a ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Performs the +=
operation. Read more
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> AddAssign<GroupProjective<P>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> AddAssign<GroupProjective<P>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Performs the +=
operation. Read more
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> AddAssign<ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> AddAssign<ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Performs the +=
operation. Read more
impl<P, F> AllocVar<GroupAffine<P>, <<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> AllocVar<GroupAffine<P>, <<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
fn new_variable<T: Borrow<SWAffine<P>>>(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn new_variable<T: Borrow<SWAffine<P>>>(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
Allocates a new variable of type Self
in the ConstraintSystem
cs
.
The mode of allocation is decided by mode
. Read more
fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>
fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>
Allocates a new constant of type Self
in the ConstraintSystem
cs
. Read more
fn new_input<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
fn new_input<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
Allocates a new public input of type Self
in the ConstraintSystem
cs
. Read more
fn new_witness<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
fn new_witness<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
Allocates a new private witness of type Self
in the ConstraintSystem
cs
. Read more
impl<P, F> AllocVar<GroupProjective<P>, <<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> AllocVar<GroupProjective<P>, <<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
fn new_variable<T: Borrow<SWProjective<P>>>(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn new_variable<T: Borrow<SWProjective<P>>>(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
Allocates a new variable of type Self
in the ConstraintSystem
cs
.
The mode of allocation is decided by mode
. Read more
fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>
fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>
) -> Result<Self, SynthesisError>
Allocates a new constant of type Self
in the ConstraintSystem
cs
. Read more
fn new_input<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
fn new_input<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
Allocates a new public input of type Self
in the ConstraintSystem
cs
. Read more
fn new_witness<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
fn new_witness<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>
) -> Result<Self, SynthesisError>
Allocates a new private witness of type Self
in the ConstraintSystem
cs
. Read more
impl<P: SWModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> Clone for ProjectiveVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone,
impl<P: SWModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> Clone for ProjectiveVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Clone,
impl<P, F> CondSelectGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> CondSelectGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
fn conditionally_select(
cond: &Boolean<<P::BaseField as Field>::BasePrimeField>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>
fn conditionally_select(
cond: &Boolean<<P::BaseField as Field>::BasePrimeField>,
true_value: &Self,
false_value: &Self
) -> Result<Self, SynthesisError>
If cond == &Boolean::TRUE
, then this returns true_value
; else,
returns false_value
. Read more
fn conditionally_select_power_of_two_vector(
position: &[Boolean<ConstraintF>],
values: &[Self]
) -> Result<Self, SynthesisError>
fn conditionally_select_power_of_two_vector(
position: &[Boolean<ConstraintF>],
values: &[Self]
) -> Result<Self, SynthesisError>
Returns an element of values
whose index in represented by position
.
position
is an array of boolean that represents an unsigned integer in big endian order. Read more
impl<P, F> CurveVar<GroupProjective<P>, <<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> CurveVar<GroupProjective<P>, <<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
Enforce that self
is in the prime-order subgroup.
Does so by multiplying by the prime order, and checking that the result is unchanged.
fn scalar_mul_le<'a>(
&self,
bits: impl Iterator<Item = &'a Boolean<<P::BaseField as Field>::BasePrimeField>>
) -> Result<Self, SynthesisError>
fn scalar_mul_le<'a>(
&self,
bits: impl Iterator<Item = &'a Boolean<<P::BaseField as Field>::BasePrimeField>>
) -> Result<Self, SynthesisError>
Computes bits * self
, where bits
is a little-endian
Boolean
representation of a scalar.
Returns a constant with value v
. Read more
Returns a Boolean
representing whether self == Self::zero()
.
fn new_variable_omit_prime_order_check(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<SWProjective<P>, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
fn new_variable_omit_prime_order_check(
cs: impl Into<Namespace<<P::BaseField as Field>::BasePrimeField>>,
f: impl FnOnce() -> Result<SWProjective<P>, SynthesisError>,
mode: AllocationMode
) -> Result<Self, SynthesisError>
Allocates a variable in the subgroup without checking if it’s in the prime-order subgroup. Read more
Sets self = self + self
.
Coputes -self
.
fn precomputed_base_scalar_mul_le<'a, I, B>(
&mut self,
scalar_bits_with_bases: I
) -> Result<(), SynthesisError> where
I: Iterator<Item = (B, &'a SWProjective<P>)>,
B: Borrow<Boolean<<P::BaseField as Field>::BasePrimeField>>,
fn precomputed_base_scalar_mul_le<'a, I, B>(
&mut self,
scalar_bits_with_bases: I
) -> Result<(), SynthesisError> where
I: Iterator<Item = (B, &'a SWProjective<P>)>,
B: Borrow<Boolean<<P::BaseField as Field>::BasePrimeField>>,
Computes a I * self
in place, where I
is a Boolean
little-endian
representation of the scalar. Read more
Computes self + self
.
fn precomputed_base_multiscalar_mul_le<'a, T: ?Sized, I, B>(
bases: &[B],
scalars: I
) -> Result<Self, SynthesisError> where
T: 'a + ToBitsGadget<ConstraintF>,
I: Iterator<Item = &'a T>,
B: Borrow<[C]>,
fn precomputed_base_multiscalar_mul_le<'a, T: ?Sized, I, B>(
bases: &[B],
scalars: I
) -> Result<Self, SynthesisError> where
T: 'a + ToBitsGadget<ConstraintF>,
I: Iterator<Item = &'a T>,
B: Borrow<[C]>,
Computes Σⱼ(scalarⱼ * baseⱼ)
for all j,
where scalarⱼ
is a Boolean
little-endian
representation of the j-th scalar. Read more
impl<P: SWModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> Debug for ProjectiveVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug,
impl<P: SWModelParameters, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>> Debug for ProjectiveVar<P, F> where
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: Debug,
impl<P, F> EqGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> EqGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
fn is_eq(
&self,
other: &Self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
fn is_eq(
&self,
other: &Self
) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError>
Output a Boolean
value representing whether self.value() == other.value()
. Read more
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
If should_enforce == true
, enforce that self
and other
are equal;
else, enforce a vacuously true statement. Read more
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal(
&self,
other: &Self,
condition: &Boolean<<P::BaseField as Field>::BasePrimeField>
) -> Result<(), SynthesisError>
If should_enforce == true
, enforce that self
and other
are not
equal; else, enforce a vacuously true statement. Read more
Output a Boolean
value representing whether self.value() != other.value()
. Read more
Enforce that self
and other
are equal. Read more
Enforce that self
and other
are not equal. Read more
impl<P, F> R1CSVar<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> R1CSVar<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
type Value = SWProjective<P>
type Value = SWProjective<P>
The type of the “native” value that Self
represents in the constraint
system. Read more
Returns the underlying ConstraintSystemRef
. Read more
Returns the value that is assigned to self
in the underlying
ConstraintSystem
. Read more
Returns true
if self
is a circuit-generation-time constant.
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<&'a ProjectiveVar<P, F>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<&'a ProjectiveVar<P, F>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<&'a ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<&'a ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the -
operator.
Performs the -
operation. Read more
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<GroupProjective<P>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<GroupProjective<P>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the -
operator.
Performs the -
operation. Read more
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<GroupProjective<P>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<GroupProjective<P>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the -
operator.
Performs the -
operation. Read more
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<ProjectiveVar<P, F>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<ProjectiveVar<P, F>> for &'a ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the -
operator.
Performs the -
operation. Read more
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> Sub<ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
type Output = ProjectiveVar<P, F>
type Output = ProjectiveVar<P, F>
The resulting type after applying the -
operator.
Performs the -
operation. Read more
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> SubAssign<&'a ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> SubAssign<&'a ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Performs the -=
operation. Read more
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> SubAssign<GroupProjective<P>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> SubAssign<GroupProjective<P>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Performs the -=
operation. Read more
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> SubAssign<ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>, P: SWModelParameters> SubAssign<ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Performs the -=
operation. Read more
impl<P, F> ToBitsGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> ToBitsGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
fn to_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
Outputs the canonical little-endian bit-wise representation of self
. Read more
fn to_non_unique_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_non_unique_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
Outputs a possibly non-unique little-endian bit-wise representation of
self
. Read more
Outputs the canonical big-endian bit-wise representation of self
.
Outputs a possibly non-unique big-endian bit-wise representation of
self
. Read more
impl<P, F> ToBytesGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
impl<P, F> ToBytesGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
fn to_bytes(
&self
) -> Result<Vec<UInt8<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_bytes(
&self
) -> Result<Vec<UInt8<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
Outputs a canonical, little-endian, byte decomposition of self
. Read more
fn to_non_unique_bytes(
&self
) -> Result<Vec<UInt8<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_non_unique_bytes(
&self
) -> Result<Vec<UInt8<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
Outputs a possibly non-unique byte decomposition of self
. Read more
impl<P, F> ToConstraintFieldGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: ToConstraintFieldGadget<<P::BaseField as Field>::BasePrimeField>,
impl<P, F> ToConstraintFieldGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
F: ToConstraintFieldGadget<<P::BaseField as Field>::BasePrimeField>,
fn to_constraint_field(
&self
) -> Result<Vec<FpVar<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_constraint_field(
&self
) -> Result<Vec<FpVar<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
Converts self
to FpVar<ConstraintF>
variables.
impl<'a, P, F> GroupOpsBounds<'a, GroupProjective<P>, ProjectiveVar<P, F>> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
impl<'a, P, F> GroupOpsBounds<'a, GroupProjective<P>, ProjectiveVar<P, F>> for &'a ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,
Auto Trait Implementations
impl<P, F> RefUnwindSafe for ProjectiveVar<P, F> where
F: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, F> Send for ProjectiveVar<P, F> where
F: Send,
impl<P, F> Sync for ProjectiveVar<P, F> where
F: Sync,
impl<P, F> Unpin for ProjectiveVar<P, F> where
F: Unpin,
P: Unpin,
impl<P, F> UnwindSafe for ProjectiveVar<P, F> where
F: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V