Trait Group

Source
pub trait Group:
    Copy
    + Clone
    + Send
    + Sync
    + 'static {
    type Scalar: FieldExt;

    // Required methods
    fn group_zero() -> Self;
    fn group_add(&mut self, rhs: &Self);
    fn group_sub(&mut self, rhs: &Self);
    fn group_scale(&mut self, by: &Self::Scalar);
}
Expand description

This represents an element of a group with basic operations that can be performed. This allows an FFT implementation (for example) to operate generically over either a field or elliptic curve group.

Required Associated Types§

Source

type Scalar: FieldExt

The group is assumed to be of prime order $p$. Scalar is the associated scalar field of size $p$.

Required Methods§

Source

fn group_zero() -> Self

Returns the additive identity of the group.

Source

fn group_add(&mut self, rhs: &Self)

Adds rhs to this group element.

Source

fn group_sub(&mut self, rhs: &Self)

Subtracts rhs from this group element.

Source

fn group_scale(&mut self, by: &Self::Scalar)

Scales this group element by a scalar.

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§