snark_verifier::util::arithmetic

Trait Group

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

Source

type Scalar: PrimeField

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

Required Methods§

Source

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.

Source

fn identity() -> Self

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

Source

fn generator() -> Self

Returns a fixed generator of the prime-order subgroup.

Source

fn is_identity(&self) -> Choice

Determines if this point is the identity.

Source

fn double(&self) -> Self

Doubles this element.

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.

Implementations on Foreign Types§

Source§

impl Group for G1Projective

Source§

impl Group for G2Projective

Source§

impl Group for Gt

Source§

impl Group for G1

Source§

impl Group for G2

Source§

impl Group for Gt

Source§

impl Group for Ed25519

Source§

impl Group for G1

Source§

impl Group for Eris

Source§

impl Group for G1

Source§

impl Group for G2

Source§

impl Group for Gt

Source§

impl Group for Secp256k1

Source§

impl Group for Secp256r1

Source§

impl Group for Secq256k1

Source§

impl Group for ProjectivePoint

Source§

impl Group for Ep

Source§

impl Group for Eq

Implementors§