Skip to main content

PointOps

Trait PointOps 

Source
pub trait PointOps: Clone + ConditionallySelectable {
    type BaseField: FieldOps;
    type Curve;

    // Required methods
    fn identity(curve: &Self::Curve) -> Self;
    fn is_identity(&self) -> bool;
    fn negate(&self, curve: &Self::Curve) -> Self;
    fn scalar_mul(&self, k: &[u64], curve: &Self::Curve) -> Self;
}
Expand description

Generic group interface for curve points.

We intentionally do not require the standard operator traits here (Add, Sub, Mul, Neg) because point addition and negation usually need access to the curve parameters. The clean abstraction boundary is a method-based API taking &Self::Curve explicitly.

Required Associated Types§

Source

type BaseField: FieldOps

The base field $\mathbb{F}_{p^M}$

Source

type Curve

The elliptic curve we’re working on

Required Methods§

Source

fn identity(curve: &Self::Curve) -> Self

Returns the identity

Source

fn is_identity(&self) -> bool

Returns true if and only if self is the identity

Source

fn negate(&self, curve: &Self::Curve) -> Self

Negate a point

Source

fn scalar_mul(&self, k: &[u64], curve: &Self::Curve) -> Self

Scalar multiplication [k]P (variable-time double-and-add).

Provided as a default so every PointOps implementor gets it automatically.

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§