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> Add for Group<E>
impl<E: Environment> Add for Group<E>
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 for Group<E>
impl<E: Environment> AddAssign 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>
Source§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§impl<E: Environment> Double for Group<E>
impl<E: Environment> Double for Group<E>
Source§impl<E: Environment> Equal for Group<E>
impl<E: Environment> Equal 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 for Group<E>where
E::Projective: PartialEq,
impl<E: PartialEq + Environment> PartialEq 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> Sub for Group<E>
impl<E: Environment> Sub for Group<E>
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 for Group<E>
impl<E: Environment> SubAssign 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> Sum for Group<E>
impl<E: Environment> Sum for Group<E>
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 write_bits_le(&self, vec: &mut Vec<bool>)
fn write_bits_le(&self, vec: &mut Vec<bool>)
Outputs the little-endian bit representation of self.to_x_coordinate()
without trailing zeros.
Source§fn write_bits_be(&self, vec: &mut Vec<bool>)
fn write_bits_be(&self, vec: &mut Vec<bool>)
Outputs the big-endian bit representation of self.to_x_coordinate()
without leading zeros.
Source§fn to_bits_le(&self) -> Vec<bool>
fn to_bits_le(&self) -> Vec<bool>
self
as a boolean array in little-endian order.Source§fn to_bits_be(&self) -> Vec<bool>
fn to_bits_be(&self) -> Vec<bool>
self
as a boolean array in big-endian order.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> StructuralPartialEq for Group<E>
Auto Trait Implementations§
impl<E> Freeze for Group<E>
impl<E> RefUnwindSafe for Group<E>
impl<E> Send for Group<E>
impl<E> Sync for Group<E>
impl<E> Unpin for Group<E>
impl<E> UnwindSafe for Group<E>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more