IsGroup

Trait 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§

Source

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.

Source

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.

Source

fn neg(&self) -> Self

Provides the inverse of the group element. This is the unique y such that for any x x.operate_with(y) returns the neutral element

Provided Methods§

Source

fn is_neutral_element(&self) -> bool

Check if an element the neutral element.

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<E: IsEdwards> IsGroup for EdwardsProjectivePoint<E>

Source§

impl<E: IsMontgomery> IsGroup for MontgomeryProjectivePoint<E>

Source§

impl<E: IsShortWeierstrass> IsGroup for ShortWeierstrassJacobianPoint<E>

Source§

impl<E: IsShortWeierstrass> IsGroup for ShortWeierstrassProjectivePoint<E>

Source§

impl<const MODULUS: u64> IsGroup for U64FieldElement<MODULUS>

Represents an element in Fp. (E.g: 0, 1, 2 are the elements of F3)