Trait generic_ec_core::Additive

source ·
pub trait Additive {
    // Required methods
    fn add(a: &Self, b: &Self) -> Self;
    fn sub(a: &Self, b: &Self) -> Self;
    fn negate(x: &Self) -> Self;

    // Provided method
    fn double(x: &Self) -> Self
       where Self: Sized { ... }
}
Expand description

Type for which addition is defined

Required Methods§

source

fn add(a: &Self, b: &Self) -> Self

Computes a + b

source

fn sub(a: &Self, b: &Self) -> Self

Computes a - b

source

fn negate(x: &Self) -> Self

Computes -a

Provided Methods§

source

fn double(x: &Self) -> Self
where Self: Sized,

Takes x, returns x + x

This can be more efficient than calling Self::add(x, x)

Object Safety§

This trait is not object safe.

Implementors§