Trait lambdaworks_math::cyclic_group::IsGroup
source · pub trait IsGroup: Clone + PartialEq + Eq {
// Required methods
fn neutral_element() -> Self;
fn operate_with(&self, other: &Self) -> Self;
fn neg(&self) -> Self;
// Provided methods
fn is_neutral_element(&self) -> bool { ... }
fn operate_with_self<T: IsUnsignedInteger>(&self, exponent: T) -> Self { ... }
}Required Methods§
sourcefn neutral_element() -> Self
fn neutral_element() -> Self
Returns the neutral element of the group. The equality
neutral_element().operate_with(g) == g must hold
for every group element g.
sourcefn operate_with(&self, other: &Self) -> Self
fn operate_with(&self, other: &Self) -> Self
Applies the group operation between self and other.
The operation can be addition or multiplication depending on
the notation of the particular group.
fn neg(&self) -> Self
Provided Methods§
sourcefn is_neutral_element(&self) -> bool
fn is_neutral_element(&self) -> bool
Check if an element the neutral element.
sourcefn operate_with_self<T: IsUnsignedInteger>(&self, exponent: T) -> Self
fn operate_with_self<T: IsUnsignedInteger>(&self, exponent: T) -> Self
Applies the group operation times times with itself
The operation can be addition or multiplication depending on
the notation of the particular group.
Implementors§
impl<E: IsEdwards> IsGroup for EdwardsProjectivePoint<E>
impl<E: IsMontgomery> IsGroup for MontgomeryProjectivePoint<E>
impl<E: IsShortWeierstrass> IsGroup for ShortWeierstrassProjectivePoint<E>
impl<const MODULUS: u64> IsGroup for U64FieldElement<MODULUS>
Represents an element in Fp. (E.g: 0, 1, 2 are the elements of F3)