Struct snarkvm_circuit_types::Group
source · pub struct Group<E>where
E: Environment,{ /* private fields */ }
Implementations§
source§impl<E> Group<E>where
E: Environment,
impl<E> Group<E>where E: Environment,
sourcepub fn from_x_coordinate(x: Field<E>) -> Group<E>
pub fn from_x_coordinate(x: Field<E>) -> Group<E>
Initializes an affine group element from a given x-coordinate field element. For safety, the resulting point is always enforced to be on the curve with constraints.
source§impl<E> Group<E>where
E: Environment,
impl<E> Group<E>where E: Environment,
sourcepub fn from_xy_coordinates(x: Field<E>, y: Field<E>) -> Group<E>
pub fn from_xy_coordinates(x: Field<E>, y: Field<E>) -> Group<E>
Initializes an affine group element from a given x- and y-coordinate field element. For safety, the resulting point is always enforced to be on the curve and in the subgroup.
source§impl<E> Group<E>where
E: Environment,
impl<E> Group<E>where E: Environment,
sourcepub fn mul_by_cofactor(&self) -> Group<E>
pub fn mul_by_cofactor(&self) -> Group<E>
Returns the product of the group element and the cofactor.
source§impl<E> Group<E>where
E: Environment,
impl<E> Group<E>where E: Environment,
sourcepub fn to_x_coordinate(&self) -> Field<E>
pub fn to_x_coordinate(&self) -> Field<E>
Returns the x-coordinate of the group element.
source§impl<E> Group<E>where
E: Environment,
impl<E> Group<E>where E: Environment,
sourcepub fn to_y_coordinate(&self) -> Field<E>
pub fn to_y_coordinate(&self) -> Field<E>
Returns the y-coordinate of the group element.
source§impl<E> Group<E>where
E: Environment,
impl<E> Group<E>where E: Environment,
sourcepub fn enforce_on_curve(&self)
pub fn enforce_on_curve(&self)
Checks (x, y)
is on the curve.
Ensure ax^2 + y^2 = 1 + dx^2y^2 by checking that y^2 * (dx^2 - 1) = (ax^2 - 1)
Trait Implementations§
source§impl<E> AddAssign<&Group<E>> for Group<E>where
E: Environment,
impl<E> AddAssign<&Group<E>> for Group<E>where E: Environment,
source§fn add_assign(&mut self, other: &Group<E>)
fn add_assign(&mut self, other: &Group<E>)
+=
operation. Read moresource§impl<E> AddAssign<Group<E>> for Group<E>where
E: Environment,
impl<E> AddAssign<Group<E>> for Group<E>where E: Environment,
source§fn add_assign(&mut self, other: Group<E>)
fn add_assign(&mut self, other: Group<E>)
+=
operation. Read moresource§impl<E> Debug for Group<E>where
E: Environment,
impl<E> Debug for Group<E>where E: Environment,
source§impl<E> Display for Group<E>where
E: Environment,
impl<E> Display for Group<E>where E: Environment,
source§impl<E> Double for Group<E>where
E: Environment,
impl<E> Double for Group<E>where E: Environment,
source§impl<E> Eject for Group<E>where
E: Environment,
impl<E> Eject for Group<E>where E: Environment,
source§fn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the group element.
source§fn eject_value(&self) -> <Group<E> as Eject>::Primitive
fn eject_value(&self) -> <Group<E> as Eject>::Primitive
Ejects the group as a constant group element.
type Primitive = Group<<E as Environment>::Network>
source§fn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
source§fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
true
if the circuit is a constant.source§fn is_private(&self) -> bool
fn is_private(&self) -> bool
true
if the circuit is a private.source§impl<E> Equal<Group<E>> for Group<E>where
E: Environment,
impl<E> Equal<Group<E>> for Group<E>where E: Environment,
source§fn is_equal(&self, other: &Group<E>) -> <Group<E> as Equal<Group<E>>>::Output
fn is_equal(&self, other: &Group<E>) -> <Group<E> as Equal<Group<E>>>::Output
Returns true
if self
and other
are equal.
This method costs 8 constraints.
source§fn is_not_equal(
&self,
other: &Group<E>
) -> <Group<E> as Equal<Group<E>>>::Output
fn is_not_equal( &self, other: &Group<E> ) -> <Group<E> as Equal<Group<E>>>::Output
Returns true
if self
and other
are not equal.
This method constructs a boolean that indicates if
self
and other
are not equal to each other.
This method costs 8 constraints.
type Output = Boolean<E>
source§impl<E> From<&Group<E>> for LinearCombination<<E as Environment>::BaseField>where
E: Environment,
impl<E> From<&Group<E>> for LinearCombination<<E as Environment>::BaseField>where E: Environment,
source§fn from(group: &Group<E>) -> LinearCombination<<E as Environment>::BaseField>
fn from(group: &Group<E>) -> LinearCombination<<E as Environment>::BaseField>
source§impl<E> From<Group<E>> for LinearCombination<<E as Environment>::BaseField>where
E: Environment,
impl<E> From<Group<E>> for LinearCombination<<E as Environment>::BaseField>where E: Environment,
source§fn from(group: Group<E>) -> LinearCombination<<E as Environment>::BaseField>
fn from(group: Group<E>) -> LinearCombination<<E as Environment>::BaseField>
source§impl<E> FromBits for Group<E>where
E: Environment,
impl<E> FromBits for Group<E>where E: Environment,
source§fn from_bits_le(bits_le: &[<Group<E> as FromBits>::Boolean]) -> Group<E>
fn from_bits_le(bits_le: &[<Group<E> as FromBits>::Boolean]) -> Group<E>
Initializes a new group element from the x-coordinate as a list of little-endian bits without trailing zeros.
source§fn from_bits_be(bits_be: &[<Group<E> as FromBits>::Boolean]) -> Group<E>
fn from_bits_be(bits_be: &[<Group<E> as FromBits>::Boolean]) -> Group<E>
Initializes a new group element from the x-coordinate as a list of big-endian bits without leading zeros.
type Boolean = Boolean<E>
source§impl<E> FromStr for Group<E>where
E: Environment,
impl<E> FromStr for Group<E>where E: Environment,
source§impl<E> Inject for Group<E>where
E: Environment,
impl<E> Inject for Group<E>where E: Environment,
source§fn new(mode: Mode, group: <Group<E> as Inject>::Primitive) -> Group<E>
fn new(mode: Mode, group: <Group<E> as Inject>::Primitive) -> Group<E>
Initializes a new affine group element.
For safety, the resulting point is always enforced to be on the curve with constraints. regardless of whether the y-coordinate was recovered.
type Primitive = Group<<E as Environment>::Network>
source§impl<E> Metrics<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>> for Group<E>where
E: Environment,
impl<E> Metrics<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>> for Group<E>where E: Environment,
source§impl<E> MulAssign<&[Boolean<E>]> for Group<E>where
E: Environment,
impl<E> MulAssign<&[Boolean<E>]> for Group<E>where E: Environment,
source§fn mul_assign(&mut self, other: &[Boolean<E>])
fn mul_assign(&mut self, other: &[Boolean<E>])
*=
operation. Read moresource§impl<E> MulAssign<&Scalar<E>> for Group<E>where
E: Environment,
impl<E> MulAssign<&Scalar<E>> for Group<E>where E: Environment,
source§fn mul_assign(&mut self, other: &Scalar<E>)
fn mul_assign(&mut self, other: &Scalar<E>)
*=
operation. Read moresource§impl<E> MulAssign<Scalar<E>> for Group<E>where
E: Environment,
impl<E> MulAssign<Scalar<E>> for Group<E>where E: Environment,
source§fn mul_assign(&mut self, other: Scalar<E>)
fn mul_assign(&mut self, other: Scalar<E>)
*=
operation. Read moresource§impl<E> Neg for &Group<E>where
E: Environment,
impl<E> Neg for &Group<E>where E: Environment,
source§impl<E> Neg for Group<E>where
E: Environment,
impl<E> Neg for Group<E>where E: Environment,
source§impl<E> OutputMode<dyn Add<Group<E>, Output = Group<E>>> for Group<E>where
E: Environment,
impl<E> OutputMode<dyn Add<Group<E>, Output = Group<E>>> for Group<E>where E: Environment,
source§impl<E> OutputMode<dyn Neg<Output = Group<E>>> for Group<E>where
E: Environment,
impl<E> OutputMode<dyn Neg<Output = Group<E>>> for Group<E>where E: Environment,
source§impl<E> OutputMode<dyn Sub<Group<E>, Output = Group<E>>> for Group<E>where
E: Environment,
impl<E> OutputMode<dyn Sub<Group<E>, Output = Group<E>>> for Group<E>where E: Environment,
source§impl<E> OutputMode<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>> for Group<E>where
E: Environment,
impl<E> OutputMode<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>> for Group<E>where E: Environment,
source§impl<E> Parser for Group<E>where
E: Environment,
impl<E> Parser for Group<E>where E: Environment,
source§impl<E> SubAssign<&Group<E>> for Group<E>where
E: Environment,
impl<E> SubAssign<&Group<E>> for Group<E>where E: Environment,
source§fn sub_assign(&mut self, other: &Group<E>)
fn sub_assign(&mut self, other: &Group<E>)
-=
operation. Read moresource§impl<E> SubAssign<Group<E>> for Group<E>where
E: Environment,
impl<E> SubAssign<Group<E>> for Group<E>where E: Environment,
source§fn sub_assign(&mut self, other: Group<E>)
fn sub_assign(&mut self, other: Group<E>)
-=
operation. Read moresource§impl<E> Ternary for Group<E>where
E: Environment,
impl<E> Ternary for Group<E>where E: Environment,
source§impl<E> ToBits for &Group<E>where
E: Environment,
impl<E> ToBits for &Group<E>where E: Environment,
source§fn to_bits_le(&self) -> Vec<<&Group<E> as ToBits>::Boolean, Global>
fn to_bits_le(&self) -> Vec<<&Group<E> as ToBits>::Boolean, Global>
Outputs the little-endian bit representation of self.x
without trailing zeros.
source§fn to_bits_be(&self) -> Vec<<&Group<E> as ToBits>::Boolean, Global>
fn to_bits_be(&self) -> Vec<<&Group<E> as ToBits>::Boolean, Global>
Outputs the big-endian bit representation of self.x
without leading zeros.
type Boolean = Boolean<E>
source§impl<E> ToBits for Group<E>where
E: Environment,
impl<E> ToBits for Group<E>where E: Environment,
source§fn to_bits_le(&self) -> Vec<<Group<E> as ToBits>::Boolean, Global>
fn to_bits_le(&self) -> Vec<<Group<E> as ToBits>::Boolean, Global>
Outputs the little-endian bit representation of self.x
without trailing zeros.
source§fn to_bits_be(&self) -> Vec<<Group<E> as ToBits>::Boolean, Global>
fn to_bits_be(&self) -> Vec<<Group<E> as ToBits>::Boolean, Global>
Outputs the big-endian bit representation of self.x
without leading zeros.