Struct snarkvm_console_types_group::Group
source · pub struct Group<E: Environment> { /* private fields */ }
Implementations
sourceimpl<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.
sourceimpl<E: Environment> Group<E>
impl<E: Environment> Group<E>
sourcepub fn from_xy_coordinates((x, y): (Field<E>, Field<E>)) -> Self
pub fn from_xy_coordinates((x, y): (Field<E>, Field<E>)) -> Self
Initializes a new group from the (x, y)
affine coordinates.
sourceimpl<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.
sourceimpl<E: Environment> Group<E>
impl<E: Environment> Group<E>
sourcepub fn to_xy_coordinate(&self) -> (Field<E>, Field<E>)
pub fn to_xy_coordinate(&self) -> (Field<E>, Field<E>)
Returns the x-coordinate and y-coordinate in the affine coordinates of the group.
sourceimpl<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.
sourceimpl<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
sourceimpl<E: Environment> Add<&Group<E>> for Group<E>
impl<E: Environment> Add<&Group<E>> for Group<E>
sourceimpl<E: Environment> Add<Group<E>> for Group<E>
impl<E: Environment> Add<Group<E>> for Group<E>
sourceimpl<E: Environment> AddAssign<&Group<E>> for Group<E>
impl<E: Environment> AddAssign<&Group<E>> for Group<E>
sourcefn add_assign(&mut self, other: &Group<E>)
fn add_assign(&mut self, other: &Group<E>)
Adds other
to self
.
sourceimpl<E: Environment> AddAssign<Group<E>> for Group<E>
impl<E: Environment> AddAssign<Group<E>> for Group<E>
sourcefn add_assign(&mut self, other: Group<E>)
fn add_assign(&mut self, other: Group<E>)
Adds other
to self
.
sourceimpl<E: Clone + Environment> Clone for Group<E>where
E::Projective: Clone,
impl<E: Clone + Environment> Clone for Group<E>where
E::Projective: Clone,
sourceimpl<E: Environment> Debug for Group<E>
impl<E: Environment> Debug for Group<E>
sourceimpl<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
sourceimpl<'de, E: Environment> Deserialize<'de> for Group<E>
impl<'de, E: Environment> Deserialize<'de> for Group<E>
sourcefn 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.
sourceimpl<E: Environment> Display for Group<E>
impl<E: Environment> Display for Group<E>
sourceimpl<E: Environment> Distribution<Group<E>> for Standard
impl<E: Environment> Distribution<Group<E>> for Standard
sourcefn 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.sourceimpl<E: Environment> Double for Group<E>
impl<E: Environment> Double for Group<E>
sourceimpl<E: Environment> Equal<Group<E>> for Group<E>
impl<E: Environment> Equal<Group<E>> for Group<E>
sourceimpl<E: Environment> FromBits for Group<E>
impl<E: Environment> FromBits for Group<E>
sourcefn 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.
sourcefn 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.
sourceimpl<E: Environment> FromBytes for Group<E>
impl<E: Environment> FromBytes for Group<E>
sourceimpl<E: Environment> FromField for Group<E>
impl<E: Environment> FromField for Group<E>
sourceimpl<E: Environment> FromFields for Group<E>
impl<E: Environment> FromFields for Group<E>
sourceimpl<E: Environment> FromStr for Group<E>
impl<E: Environment> FromStr for Group<E>
sourceimpl<E: Hash + Environment> Hash for Group<E>where
E::Projective: Hash,
impl<E: Hash + Environment> Hash for Group<E>where
E::Projective: Hash,
sourceimpl<E: Environment> Mul<&Group<E>> for Scalar<E>
impl<E: Environment> Mul<&Group<E>> for Scalar<E>
sourceimpl<E: Environment> Mul<&Scalar<E>> for Group<E>
impl<E: Environment> Mul<&Scalar<E>> for Group<E>
sourceimpl<E: Environment> Mul<Group<E>> for Scalar<E>
impl<E: Environment> Mul<Group<E>> for Scalar<E>
sourceimpl<E: Environment> Mul<Scalar<E>> for Group<E>
impl<E: Environment> Mul<Scalar<E>> for Group<E>
sourceimpl<E: Environment> MulAssign<&Scalar<E>> for Group<E>
impl<E: Environment> MulAssign<&Scalar<E>> for Group<E>
sourcefn mul_assign(&mut self, other: &Scalar<E>)
fn mul_assign(&mut self, other: &Scalar<E>)
Multiplies self
by other
.
sourceimpl<E: Environment> MulAssign<Scalar<E>> for Group<E>
impl<E: Environment> MulAssign<Scalar<E>> for Group<E>
sourcefn mul_assign(&mut self, other: Scalar<E>)
fn mul_assign(&mut self, other: Scalar<E>)
Multiplies self
by other
.
sourceimpl<E: Environment> Neg for Group<E>
impl<E: Environment> Neg for Group<E>
sourceimpl<E: Environment> Parser for Group<E>
impl<E: Environment> Parser for Group<E>
sourcefn parse(string: &str) -> ParserResult<'_, Self>
fn parse(string: &str) -> ParserResult<'_, Self>
Parses a string into a group circuit.
sourceimpl<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,
sourceimpl<E: Environment> Serialize for Group<E>
impl<E: Environment> Serialize for Group<E>
sourceimpl<E: Environment> SizeInBits for Group<E>
impl<E: Environment> SizeInBits for Group<E>
sourcefn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the group size in bits.
sourceimpl<E: Environment> SizeInBytes for Group<E>
impl<E: Environment> SizeInBytes for Group<E>
sourcefn size_in_bytes() -> usize
fn size_in_bytes() -> usize
Returns the group size in bytes.
sourceimpl<E: Environment> Sub<&Group<E>> for Group<E>
impl<E: Environment> Sub<&Group<E>> for Group<E>
sourceimpl<E: Environment> Sub<Group<E>> for Group<E>
impl<E: Environment> Sub<Group<E>> for Group<E>
sourceimpl<E: Environment> SubAssign<&Group<E>> for Group<E>
impl<E: Environment> SubAssign<&Group<E>> for Group<E>
sourcefn sub_assign(&mut self, other: &Group<E>)
fn sub_assign(&mut self, other: &Group<E>)
Subtracts other
from self
.
sourceimpl<E: Environment> SubAssign<Group<E>> for Group<E>
impl<E: Environment> SubAssign<Group<E>> for Group<E>
sourcefn sub_assign(&mut self, other: Group<E>)
fn sub_assign(&mut self, other: Group<E>)
Subtracts other
from self
.