Skip to main content

DisLogPoint

Trait DisLogPoint 

Source
pub trait DisLogPoint:
    Clone
    + Bytes
    + Debug {
    type Scalar: ScalarNumber;

    const SIZE: usize;

    // Required methods
    fn zero() -> Self;
    fn one() -> Self;
    fn basepoint() -> Self;
    fn add(&self, rhs: &Self) -> Self;
    fn mul(&self, rhs: &Self::Scalar) -> Self;
    fn neg(&self) -> Self;
    fn eq(&self, o: &Self) -> bool;

    // Provided method
    fn sub(&self, rhs: &Self) -> Self
       where Self: Sized { ... }
}
Expand description

Point operator for this curve on finite finite $G_p$

Required Associated Constants§

Source

const SIZE: usize

Point size in bytes.

Required Associated Types§

Source

type Scalar: ScalarNumber

This point type’s associated scalar type.

Beacuse point can’t multiply by point, We need use scalar multiply for point.

Required Methods§

Source

fn zero() -> Self

Get a point means zero.

Source

fn one() -> Self

Get a point means one.

Source

fn basepoint() -> Self

Get a base point for this curve.

Source

fn add(&self, rhs: &Self) -> Self

Add two point.

Source

fn mul(&self, rhs: &Self::Scalar) -> Self

Scalar multiply for point.

Source

fn neg(&self) -> Self

Negative a point.

Source

fn eq(&self, o: &Self) -> bool

Two point is equal.

Provided Methods§

Source

fn sub(&self, rhs: &Self) -> Self
where Self: Sized,

Subtraction two point.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§