[][src]Trait rcrypto::elliptic::EllipticCurve

pub trait EllipticCurve {
    fn curve_params(&self) -> &CurveParams;
fn is_on_curve(&self, x: &BigInt, y: &BigInt) -> bool;
fn add(
        &self,
        x1: &BigInt,
        y1: &BigInt,
        x2: &BigInt,
        y2: &BigInt
    ) -> (BigInt, BigInt);
fn double(&self, x: &BigInt, y: &BigInt) -> (BigInt, BigInt);
fn scalar(&self, x: &BigInt, y: &BigInt, k: &Nat) -> (BigInt, BigInt);
fn scalar_base_point(&self, k: &Nat) -> (BigInt, BigInt); }

A Curve represents a short-form Weierstrass curve with a=-3.
(0, 0) identifies the infinite point. See https://www.hyperelliptic.org/EFD/g1p/auto-shortw.html

Required methods

fn curve_params(&self) -> &CurveParams

fn is_on_curve(&self, x: &BigInt, y: &BigInt) -> bool

reports whether the given (x,y) lies on the curve

fn add(
    &self,
    x1: &BigInt,
    y1: &BigInt,
    x2: &BigInt,
    y2: &BigInt
) -> (BigInt, BigInt)

(x1, y1) + (x2, y2)

fn double(&self, x: &BigInt, y: &BigInt) -> (BigInt, BigInt)

(x, y) * 2

fn scalar(&self, x: &BigInt, y: &BigInt, k: &Nat) -> (BigInt, BigInt)

(x, y) * k

fn scalar_base_point(&self, k: &Nat) -> (BigInt, BigInt)

base point (gx, gy) * k -> (zx, zy)

Loading content...

Implementors

impl EllipticCurve for CurveP224[src]

impl EllipticCurve for CurveP256[src]

impl EllipticCurve for CurveParams[src]

Loading content...