1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#![no_std]
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]

use cryptix_field::group::AbelianGroup;

pub trait CurvePoint: AbelianGroup {
    const GENERATOR: Self;

    type MulScalar;

    /// k * self
    fn scalar_mul(self, k: Self::MulScalar) -> Self;

    /// 2 * self
    fn double(self) -> Self;

    /// whether current point is at infinity
    fn at_inf(&self) -> bool;

    fn on_curve(&self) -> bool;

    /// convert point into affine coordinate
    fn normalize(self) -> Self;
    
    fn mont_form(self) -> Self;
    fn mont_rdc(self) -> Self;
}