Struct snarkvm_console_algorithms::Group
[−]pub struct Group<E> where
E: Environment, { /* private fields */ }
Implementations
impl<E> Group<E> where
E: Environment,
impl<E> Group<E> where
E: Environment,
pub fn from_x_coordinate(x_coordinate: Field<E>) -> Result<Group<E>, Error>
pub fn from_x_coordinate(x_coordinate: Field<E>) -> Result<Group<E>, Error>
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.
impl<E> Group<E> where
E: Environment,
impl<E> Group<E> where
E: Environment,
pub fn from_xy_coordinates((Field<E>, Field<E>)) -> Group<E>
pub fn from_xy_coordinates((Field<E>, Field<E>)) -> Group<E>
Initializes a new group from the (x, y)
affine coordinates.
impl<E> Group<E> where
E: Environment,
impl<E> Group<E> where
E: Environment,
pub 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.
impl<E> Group<E> where
E: Environment,
impl<E> Group<E> where
E: Environment,
pub 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.
impl<E> Group<E> where
E: Environment,
impl<E> Group<E> where
E: Environment,
pub 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.
impl<E> Group<E> where
E: Environment,
impl<E> Group<E> where
E: Environment,
pub const EDWARDS_A: Field<E> = Field<E>::new(E::EDWARDS_A)
pub const EDWARDS_A: Field<E> = Field<E>::new(E::EDWARDS_A)
The coefficient A for the twisted Edwards curve equation.
pub const EDWARDS_D: Field<E> = Field<E>::new(E::EDWARDS_D)
pub const EDWARDS_D: Field<E> = Field<E>::new(E::EDWARDS_D)
The coefficient D for the twisted Edwards curve equation.
pub const MONTGOMERY_A: Field<E> = Field<E>::new(E::MONTGOMERY_A)
pub const MONTGOMERY_A: Field<E> = Field<E>::new(E::MONTGOMERY_A)
The coefficient A for the Montgomery curve equation.
pub const MONTGOMERY_B: Field<E> = Field<E>::new(E::MONTGOMERY_B)
pub const MONTGOMERY_B: Field<E> = Field<E>::new(E::MONTGOMERY_B)
The coefficient B for the Montgomery curve equation.
pub fn new(group: <E as Environment>::Affine) -> Group<E>
pub fn new(group: <E as Environment>::Affine) -> Group<E>
Initializes a new group.
pub fn mul_by_cofactor(&self) -> Group<E>
pub fn mul_by_cofactor(&self) -> Group<E>
Returns self * COFACTOR
.
pub fn div_by_cofactor(&self) -> Group<E>
pub fn div_by_cofactor(&self) -> Group<E>
Returns self / COFACTOR
.
Trait Implementations
impl<E> Add<&Group<E>> for Group<E> where
E: Environment,
impl<E> Add<&Group<E>> for Group<E> where
E: Environment,
impl<E> Add<Group<E>> for Group<E> where
E: Environment,
impl<E> Add<Group<E>> for Group<E> where
E: Environment,
impl<E> AddAssign<&Group<E>> for Group<E> where
E: Environment,
impl<E> AddAssign<&Group<E>> for Group<E> where
E: Environment,
fn add_assign(&mut self, other: &Group<E>)
fn add_assign(&mut self, other: &Group<E>)
Adds other
to self
.
impl<E> AddAssign<Group<E>> for Group<E> where
E: Environment,
impl<E> AddAssign<Group<E>> for Group<E> where
E: Environment,
fn add_assign(&mut self, other: Group<E>)
fn add_assign(&mut self, other: Group<E>)
Adds other
to self
.
impl<E> Clone for Group<E> where
E: Clone + Environment,
<E as Environment>::Projective: Clone,
impl<E> Clone for Group<E> where
E: Clone + Environment,
<E as Environment>::Projective: Clone,
impl<E> Debug for Group<E> where
E: Environment,
impl<E> Debug for Group<E> where
E: Environment,
impl<E> Deref for Group<E> where
E: Environment,
impl<E> Deref for Group<E> where
E: Environment,
type Target = <E as Environment>::Projective
type Target = <E as Environment>::Projective
The resulting type after dereferencing.
impl<'de, E> Deserialize<'de> for Group<E> where
E: Environment,
impl<'de, E> Deserialize<'de> for Group<E> where
E: Environment,
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.
impl<E> Display for Group<E> where
E: Environment,
impl<E> Display for Group<E> where
E: Environment,
impl<E> Distribution<Group<E>> for Standard where
E: Environment,
impl<E> Distribution<Group<E>> for Standard where
E: Environment,
fn sample<R>(&self, rng: &mut R) -> Group<E> where
R: Rng + ?Sized,
fn sample<R>(&self, rng: &mut R) -> Group<E> where
R: Rng + ?Sized,
Generate a random value of T
, using rng
as the source of randomness.
sourcefn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
impl<E> Double for Group<E> where
E: Environment,
impl<E> Double for Group<E> where
E: Environment,
impl<E> Equal<Group<E>> for Group<E> where
E: Environment,
impl<E> Equal<Group<E>> for Group<E> where
E: Environment,
impl<E> FromBits for Group<E> where
E: Environment,
impl<E> FromBits for Group<E> where
E: Environment,
fn from_bits_le(bits_le: &[bool]) -> Result<Group<E>, Error>
fn from_bits_le(bits_le: &[bool]) -> Result<Group<E>, Error>
Initializes a new group by recovering the x-coordinate of an affine group from a list of little-endian bits.
fn from_bits_be(bits_be: &[bool]) -> Result<Group<E>, Error>
fn from_bits_be(bits_be: &[bool]) -> Result<Group<E>, Error>
Initializes a new group by recovering the x-coordinate of an affine group from a list of big-endian bits.
impl<E> FromBytes for Group<E> where
E: Environment,
impl<E> FromBytes for Group<E> where
E: Environment,
impl<E> FromField for Group<E> where
E: Environment,
impl<E> FromField for Group<E> where
E: Environment,
impl<E> FromFields for Group<E> where
E: Environment,
impl<E> FromFields for Group<E> where
E: Environment,
fn from_fields(
fields: &[<Group<E> as FromFields>::Field]
) -> Result<Group<E>, Error>
fn from_fields(
fields: &[<Group<E> as FromFields>::Field]
) -> Result<Group<E>, Error>
Initializes a new group by recovering the x-coordinate of an affine group from a field element.
type Field = Field<E>
impl<E> FromStr for Group<E> where
E: Environment,
impl<E> FromStr for Group<E> where
E: Environment,
impl<E> Hash for Group<E> where
E: Hash + Environment,
<E as Environment>::Projective: Hash,
impl<E> Hash for Group<E> where
E: Hash + Environment,
<E as Environment>::Projective: Hash,
impl<E> Mul<&Group<E>> for Scalar<E> where
E: Environment,
impl<E> Mul<&Group<E>> for Scalar<E> where
E: Environment,
impl<E> Mul<&Scalar<E>> for Group<E> where
E: Environment,
impl<E> Mul<&Scalar<E>> for Group<E> where
E: Environment,
impl<E> Mul<Group<E>> for Scalar<E> where
E: Environment,
impl<E> Mul<Group<E>> for Scalar<E> where
E: Environment,
impl<E> Mul<Scalar<E>> for Group<E> where
E: Environment,
impl<E> Mul<Scalar<E>> for Group<E> where
E: Environment,
impl<E> MulAssign<&Scalar<E>> for Group<E> where
E: Environment,
impl<E> MulAssign<&Scalar<E>> for Group<E> where
E: Environment,
fn mul_assign(&mut self, other: &Scalar<E>)
fn mul_assign(&mut self, other: &Scalar<E>)
Multiplies self
by other
.
impl<E> MulAssign<Scalar<E>> for Group<E> where
E: Environment,
impl<E> MulAssign<Scalar<E>> for Group<E> where
E: Environment,
fn mul_assign(&mut self, other: Scalar<E>)
fn mul_assign(&mut self, other: Scalar<E>)
Multiplies self
by other
.
impl<E> Neg for Group<E> where
E: Environment,
impl<E> Neg for Group<E> where
E: Environment,
impl<E> Parser for Group<E> where
E: Environment,
impl<E> Parser for Group<E> where
E: Environment,
impl<E> PartialEq<Group<E>> for Group<E> where
E: PartialEq<E> + Environment,
<E as Environment>::Projective: PartialEq<<E as Environment>::Projective>,
impl<E> PartialEq<Group<E>> for Group<E> where
E: PartialEq<E> + Environment,
<E as Environment>::Projective: PartialEq<<E as Environment>::Projective>,
impl<E> Serialize for Group<E> where
E: Environment,
impl<E> Serialize for Group<E> where
E: Environment,
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.
impl<E> SizeInBits for Group<E> where
E: Environment,
impl<E> SizeInBits for Group<E> where
E: Environment,
fn size_in_bits() -> usize
fn size_in_bits() -> usize
Returns the group size in bits.
impl<E> SizeInBytes for Group<E> where
E: Environment,
impl<E> SizeInBytes for Group<E> where
E: Environment,
fn size_in_bytes() -> usize
fn size_in_bytes() -> usize
Returns the group size in bytes.
impl<E> Sub<&Group<E>> for Group<E> where
E: Environment,
impl<E> Sub<&Group<E>> for Group<E> where
E: Environment,
impl<E> Sub<Group<E>> for Group<E> where
E: Environment,
impl<E> Sub<Group<E>> for Group<E> where
E: Environment,
impl<E> SubAssign<&Group<E>> for Group<E> where
E: Environment,
impl<E> SubAssign<&Group<E>> for Group<E> where
E: Environment,
fn sub_assign(&mut self, other: &Group<E>)
fn sub_assign(&mut self, other: &Group<E>)
Subtracts other
from self
.
impl<E> SubAssign<Group<E>> for Group<E> where
E: Environment,
impl<E> SubAssign<Group<E>> for Group<E> where
E: Environment,
fn sub_assign(&mut self, other: Group<E>)
fn sub_assign(&mut self, other: Group<E>)
Subtracts other
from self
.
impl<'a, E> Sum<&'a Group<E>> for Group<E> where
E: Environment,
impl<'a, E> Sum<&'a Group<E>> for Group<E> where
E: Environment,
impl<E> Sum<Group<E>> for Group<E> where
E: Environment,
impl<E> Sum<Group<E>> for Group<E> where
E: Environment,
impl<E> Ternary for Group<E> where
E: Environment,
impl<E> Ternary for Group<E> where
E: Environment,
impl<E> ToBits for Group<E> where
E: Environment,
impl<E> ToBits for Group<E> where
E: Environment,
impl<E> ToBytes for Group<E> where
E: Environment,
impl<E> ToBytes for Group<E> where
E: Environment,
impl<E> ToField for Group<E> where
E: Environment,
impl<E> ToField for Group<E> where
E: Environment,
impl<E> ToFields for Group<E> where
E: Environment,
impl<E> ToFields for Group<E> where
E: Environment,
impl<E> TypeName for Group<E> where
E: Environment,
impl<E> TypeName for Group<E> where
E: Environment,
impl<E> Visibility for Group<E> where
E: Environment,
impl<E> Visibility for Group<E> where
E: Environment,
impl<E> Zero for Group<E> where
E: Environment,
impl<E> Zero for Group<E> where
E: Environment,
impl<E> Copy for Group<E> where
E: Copy + Environment,
<E as Environment>::Projective: Copy,
impl<E> Eq for Group<E> where
E: Eq + Environment,
<E as Environment>::Projective: Eq,
impl<E> GroupTrait<Scalar<E>> for Group<E> where
E: Environment,
impl<E> StructuralEq for Group<E> where
E: Environment,
impl<E> StructuralPartialEq for Group<E> where
E: Environment,
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more