pub trait Group: Sized + Clone + Copy + Debug + Eq + Send + Sync + 'static + Sum + for<'a> Sum<&'a Self> + Neg<Output = Self> + GroupOps + GroupOpsOwned + ScalarMul<Self::Scalar> + ScalarMulOwned<Self::Scalar> {
    type Scalar: PrimeField;

    // Required methods
    fn random(rng: impl RngCore) -> Self;
    fn identity() -> Self;
    fn generator() -> Self;
    fn is_identity(&self) -> Choice;
    fn double(&self) -> Self;
}
Expand description

This trait represents an element of a cryptographic group.

Required Associated Types§

type Scalar: PrimeField

Scalars modulo the order of this group’s scalar field.

Required Methods§

fn random(rng: impl RngCore) -> Self

Returns an element chosen uniformly at random from the non-identity elements of this group.

This function is non-deterministic, and samples from the user-provided RNG.

fn identity() -> Self

Returns the additive identity, also known as the “neutral element”.

fn generator() -> Self

Returns a fixed generator of the prime-order subgroup.

fn is_identity(&self) -> Choice

Determines if this point is the identity.

fn double(&self) -> Self

Doubles this element.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl Group for Ep

§

type Scalar = Fq

§

fn random(rng: impl RngCore) -> Ep

§

fn generator() -> Ep

§

fn double(&self) -> Ep

§

fn identity() -> Ep

§

fn is_identity(&self) -> Choice

§

impl Group for Eq

§

type Scalar = Fp

§

fn random(rng: impl RngCore) -> Eq

§

fn generator() -> Eq

§

fn double(&self) -> Eq

§

fn identity() -> Eq

§

fn is_identity(&self) -> Choice

Implementors§