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,
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 a new group from the (x, y)
affine coordinates.
Sourcepub fn from_xy_coordinates_unchecked(x: Field<E>, y: Field<E>) -> Group<E>
pub fn from_xy_coordinates_unchecked(x: Field<E>, y: Field<E>) -> Group<E>
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> 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 in the affine coordinates of the group.
Source§impl<E> Group<E>where
E: Environment,
impl<E> Group<E>where
E: Environment,
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> 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 in the affine coordinates of the group.
Source§impl<E> Group<E>where
E: Environment,
impl<E> Group<E>where
E: Environment,
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 new(group: <E as Environment>::Affine) -> Group<E>
pub fn new(group: <E as Environment>::Affine) -> Group<E>
Initializes a new group.
Sourcepub fn mul_by_cofactor(&self) -> Group<E>
pub fn mul_by_cofactor(&self) -> Group<E>
Returns self * COFACTOR
.
Sourcepub fn div_by_cofactor(&self) -> Group<E>
pub fn div_by_cofactor(&self) -> Group<E>
Returns self / COFACTOR
.
Trait Implementations§
Source§impl<E> Add for Group<E>where
E: Environment,
impl<E> Add for Group<E>where
E: Environment,
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>)
Adds other
to self
.
Source§impl<E> AddAssign for Group<E>where
E: Environment,
impl<E> AddAssign for Group<E>where
E: Environment,
Source§fn add_assign(&mut self, other: Group<E>)
fn add_assign(&mut self, other: Group<E>)
Adds other
to self
.
Source§impl<E> Debug for Group<E>where
E: Environment,
impl<E> Debug for Group<E>where
E: Environment,
Source§impl<E> Deref for Group<E>where
E: Environment,
impl<E> Deref for Group<E>where
E: Environment,
Source§impl<'de, E> Deserialize<'de> for Group<E>where
E: Environment,
impl<'de, E> Deserialize<'de> for Group<E>where
E: Environment,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Group<E>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Group<E>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserializes the group from a string or bytes.
Source§impl<E> Display for Group<E>where
E: Environment,
impl<E> Display for Group<E>where
E: Environment,
Source§impl<E> Distribution<Group<E>> for Standardwhere
E: Environment,
impl<E> Distribution<Group<E>> for Standardwhere
E: Environment,
Source§impl<E> Double for Group<E>where
E: Environment,
impl<E> Double for Group<E>where
E: Environment,
Source§impl<E> Equal for Group<E>where
E: Environment,
impl<E> Equal for Group<E>where
E: Environment,
Source§impl<E> FromBits for Group<E>where
E: Environment,
impl<E> FromBits for Group<E>where
E: Environment,
Source§impl<E> FromBytes for Group<E>where
E: Environment,
impl<E> FromBytes for Group<E>where
E: Environment,
Source§impl<E> FromField for Group<E>where
E: Environment,
impl<E> FromField for Group<E>where
E: Environment,
Source§impl<E> FromFields for Group<E>where
E: Environment,
impl<E> FromFields for Group<E>where
E: Environment,
Source§impl<E> FromStr for Group<E>where
E: Environment,
impl<E> FromStr for Group<E>where
E: Environment,
Source§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>)
Multiplies self
by other
.
Source§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>)
Multiplies self
by other
.
Source§impl<E> Neg for Group<E>where
E: Environment,
impl<E> Neg 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> Serialize for Group<E>where
E: Environment,
impl<E> Serialize for Group<E>where
E: Environment,
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serializes the group into a string or as bytes.
Source§impl<E> SizeInBits for Group<E>where
E: Environment,
impl<E> SizeInBits for Group<E>where
E: Environment,
Source§fn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the group size in bits.
Source§impl<E> SizeInBytes for Group<E>where
E: Environment,
impl<E> SizeInBytes for Group<E>where
E: Environment,
Source§fn size_in_bytes() -> usize
fn size_in_bytes() -> usize
Returns the group size in bytes.
Source§impl<E> Sub for Group<E>where
E: Environment,
impl<E> Sub 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>)
Subtracts other
from self
.
Source§impl<E> SubAssign for Group<E>where
E: Environment,
impl<E> SubAssign for Group<E>where
E: Environment,
Source§fn sub_assign(&mut self, other: Group<E>)
fn sub_assign(&mut self, other: Group<E>)
Subtracts other
from self
.
Source§impl<E> Sum for Group<E>where
E: Environment,
impl<E> Sum for Group<E>where
E: Environment,
Source§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 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> ToBytes for Group<E>where
E: Environment,
impl<E> ToBytes for Group<E>where
E: Environment,
Source§impl<E> ToField for Group<E>where
E: Environment,
impl<E> ToField for Group<E>where
E: Environment,
Source§impl<E> ToFields for Group<E>where
E: Environment,
impl<E> ToFields for Group<E>where
E: Environment,
Source§impl<E> TypeName for Group<E>where
E: Environment,
impl<E> TypeName for Group<E>where
E: Environment,
Source§impl<E> Visibility for Group<E>where
E: Environment,
impl<E> Visibility for Group<E>where
E: Environment,
Source§impl<E> Zero for Group<E>where
E: Environment,
impl<E> Zero for Group<E>where
E: Environment,
impl<E> Copy for Group<E>
impl<E> Eq for Group<E>
impl<E> GroupTrait<Scalar<E>> for Group<E>where
E: Environment,
impl<E> StructuralPartialEq for Group<E>where
E: Environment,
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