Struct snarkvm_console_types_group::Group
source · pub struct Group<E: Environment> { /* private fields */ }
Implementations§
source§impl<E: Environment> Group<E>
impl<E: Environment> Group<E>
sourcepub fn from_x_coordinate(x_coordinate: Field<E>) -> Result<Self>
pub fn from_x_coordinate(x_coordinate: Field<E>) -> Result<Self>
Attempts to recover an affine group element from a given x-coordinate field element. For safety, the resulting point is always enforced to be on the curve and in the correct subgroup.
source§impl<E: Environment> Group<E>
impl<E: Environment> Group<E>
sourcepub fn from_xy_coordinates(x: Field<E>, y: Field<E>) -> Self
pub fn from_xy_coordinates(x: Field<E>, y: Field<E>) -> Self
Initializes a new group from the (x, y)
affine coordinates.
sourcepub fn from_xy_coordinates_unchecked(x: Field<E>, y: Field<E>) -> Self
pub fn from_xy_coordinates_unchecked(x: Field<E>, y: Field<E>) -> Self
Initializes a new group from the (x, y)
affine coordinates.
Note: The resulting point is not enforced to be on the curve or in the subgroup.
source§impl<E: Environment> Group<E>
impl<E: Environment> Group<E>
sourcepub fn to_x_coordinate(&self) -> Field<E>
pub fn to_x_coordinate(&self) -> Field<E>
Returns the x-coordinate in the affine coordinates of the group.
source§impl<E: Environment> Group<E>
impl<E: Environment> Group<E>
sourcepub fn to_xy_coordinates(&self) -> (Field<E>, Field<E>)
pub fn to_xy_coordinates(&self) -> (Field<E>, Field<E>)
Returns the x-coordinate and y-coordinate in the affine coordinates of the group.
source§impl<E: Environment> Group<E>
impl<E: Environment> Group<E>
sourcepub fn to_y_coordinate(&self) -> Field<E>
pub fn to_y_coordinate(&self) -> Field<E>
Returns the y-coordinate in the affine coordinates of the group.
source§impl<E: Environment> Group<E>
impl<E: Environment> Group<E>
sourcepub const MONTGOMERY_A: Field<E> = _
pub const MONTGOMERY_A: Field<E> = _
The coefficient A for the Montgomery curve equation.
sourcepub const MONTGOMERY_B: Field<E> = _
pub const MONTGOMERY_B: Field<E> = _
The coefficient B for the Montgomery curve equation.
sourcepub fn mul_by_cofactor(&self) -> Self
pub fn mul_by_cofactor(&self) -> Self
Returns self * COFACTOR
.
sourcepub fn div_by_cofactor(&self) -> Self
pub fn div_by_cofactor(&self) -> Self
Returns self / COFACTOR
.
Trait Implementations§
source§impl<E: Environment> AddAssign<&Group<E>> for Group<E>
impl<E: Environment> AddAssign<&Group<E>> for Group<E>
source§fn add_assign(&mut self, other: &Group<E>)
fn add_assign(&mut self, other: &Group<E>)
Adds other
to self
.
source§impl<E: Environment> AddAssign<Group<E>> for Group<E>
impl<E: Environment> AddAssign<Group<E>> for Group<E>
source§fn add_assign(&mut self, other: Group<E>)
fn add_assign(&mut self, other: Group<E>)
Adds other
to self
.
source§impl<E: Clone + Environment> Clone for Group<E>where
E::Projective: Clone,
impl<E: Clone + Environment> Clone for Group<E>where E::Projective: Clone,
source§impl<E: Environment> Debug for Group<E>
impl<E: Environment> Debug for Group<E>
source§impl<E: Environment> Deref for Group<E>
impl<E: Environment> Deref for Group<E>
§type Target = <E as Environment>::Projective
type Target = <E as Environment>::Projective
source§impl<'de, E: Environment> Deserialize<'de> for Group<E>
impl<'de, E: Environment> Deserialize<'de> for Group<E>
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes the group from a string or bytes.
source§impl<E: Environment> Display for Group<E>
impl<E: Environment> Display for Group<E>
source§impl<E: Environment> Distribution<Group<E>> for Standard
impl<E: Environment> Distribution<Group<E>> for Standard
source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Group<E>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Group<E>
T
, using rng
as the source of randomness.source§impl<E: Environment> Double for Group<E>
impl<E: Environment> Double for Group<E>
source§impl<E: Environment> FromBits for Group<E>
impl<E: Environment> FromBits for Group<E>
source§fn from_bits_le(bits_le: &[bool]) -> Result<Self>
fn from_bits_le(bits_le: &[bool]) -> Result<Self>
Initializes a new group by recovering the x-coordinate of an affine group from a list of little-endian bits.
source§fn from_bits_be(bits_be: &[bool]) -> Result<Self>
fn from_bits_be(bits_be: &[bool]) -> Result<Self>
Initializes a new group by recovering the x-coordinate of an affine group from a list of big-endian bits.
source§impl<E: Environment> FromBytes for Group<E>
impl<E: Environment> FromBytes for Group<E>
source§impl<E: Environment> FromField for Group<E>
impl<E: Environment> FromField for Group<E>
source§impl<E: Environment> FromFields for Group<E>
impl<E: Environment> FromFields for Group<E>
source§impl<E: Environment> FromStr for Group<E>
impl<E: Environment> FromStr for Group<E>
source§impl<E: Hash + Environment> Hash for Group<E>where
E::Projective: Hash,
impl<E: Hash + Environment> Hash for Group<E>where E::Projective: Hash,
source§impl<E: Environment> MulAssign<&Scalar<E>> for Group<E>
impl<E: Environment> MulAssign<&Scalar<E>> for Group<E>
source§fn mul_assign(&mut self, other: &Scalar<E>)
fn mul_assign(&mut self, other: &Scalar<E>)
Multiplies self
by other
.
source§impl<E: Environment> MulAssign<Scalar<E>> for Group<E>
impl<E: Environment> MulAssign<Scalar<E>> for Group<E>
source§fn mul_assign(&mut self, other: Scalar<E>)
fn mul_assign(&mut self, other: Scalar<E>)
Multiplies self
by other
.
source§impl<E: Environment> Neg for Group<E>
impl<E: Environment> Neg for Group<E>
source§impl<E: Environment> Parser for Group<E>
impl<E: Environment> Parser for Group<E>
source§fn parse(string: &str) -> ParserResult<'_, Self>
fn parse(string: &str) -> ParserResult<'_, Self>
Parses a string into a group circuit.
source§impl<E: PartialEq + Environment> PartialEq<Group<E>> for Group<E>where
E::Projective: PartialEq,
impl<E: PartialEq + Environment> PartialEq<Group<E>> for Group<E>where E::Projective: PartialEq,
source§impl<E: Environment> Serialize for Group<E>
impl<E: Environment> Serialize for Group<E>
source§impl<E: Environment> SizeInBits for Group<E>
impl<E: Environment> SizeInBits for Group<E>
source§fn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the group size in bits.
source§impl<E: Environment> SizeInBytes for Group<E>
impl<E: Environment> SizeInBytes for Group<E>
source§fn size_in_bytes() -> usize
fn size_in_bytes() -> usize
Returns the group size in bytes.
source§impl<E: Environment> SubAssign<&Group<E>> for Group<E>
impl<E: Environment> SubAssign<&Group<E>> for Group<E>
source§fn sub_assign(&mut self, other: &Group<E>)
fn sub_assign(&mut self, other: &Group<E>)
Subtracts other
from self
.
source§impl<E: Environment> SubAssign<Group<E>> for Group<E>
impl<E: Environment> SubAssign<Group<E>> for Group<E>
source§fn sub_assign(&mut self, other: Group<E>)
fn sub_assign(&mut self, other: Group<E>)
Subtracts other
from self
.
source§impl<E: Environment> Ternary for Group<E>
impl<E: Environment> Ternary for Group<E>
source§impl<E: Environment> ToBits for Group<E>
impl<E: Environment> ToBits for Group<E>
source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
Outputs the little-endian bit representation of self.to_x_coordinate()
without trailing zeros.
source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
Outputs the big-endian bit representation of self.to_x_coordinate()
without leading zeros.
source§impl<E: Environment> ToBytes for Group<E>
impl<E: Environment> ToBytes for Group<E>
source§impl<E: Environment> ToField for Group<E>
impl<E: Environment> ToField for Group<E>
source§impl<E: Environment> ToFields for Group<E>
impl<E: Environment> ToFields for Group<E>
source§impl<E: Environment> TypeName for Group<E>
impl<E: Environment> TypeName for Group<E>
source§impl<E: Environment> Visibility for Group<E>
impl<E: Environment> Visibility for Group<E>
source§impl<E: Environment> Zero for Group<E>
impl<E: Environment> Zero for Group<E>
impl<E: Copy + Environment> Copy for Group<E>where E::Projective: Copy,
impl<E: Eq + Environment> Eq for Group<E>where E::Projective: Eq,
impl<E: Environment> GroupTrait<Scalar<E>> for Group<E>
impl<E: Environment> StructuralEq for Group<E>
impl<E: Environment> StructuralPartialEq for Group<E>
Auto Trait Implementations§
impl<E> RefUnwindSafe for Group<E>where <E as Environment>::Projective: RefUnwindSafe,
impl<E> Send for Group<E>
impl<E> Sync for Group<E>
impl<E> Unpin for Group<E>where <E as Environment>::Projective: Unpin,
impl<E> UnwindSafe for Group<E>where <E as Environment>::Projective: UnwindSafe,
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
§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere T: DeserializeOwned,
fn take_from_value<D>( value: &mut Value, field: &str ) -> Result<T, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.