use generic_array::ArrayLength; use crate::line::{Array, LineValid}; pub trait Scalar where Self: LineValid, { fn add_ff(&self, rhs: &Self) -> Result; fn sub_ff(&self, rhs: &Self) -> Result; fn mul_ff(&self, rhs: &Self) -> Result; fn inv_ff(&self) -> Result; } pub trait Curve where Self: LineValid, { type Scalar: Scalar; type CompressedLength: ArrayLength; type CoordinateLength: ArrayLength; const NAME: &'static str; fn base() -> Self; fn mul_ec(&self, rhs: &Self) -> Self; fn exp_ec(&self, rhs: &Self::Scalar) -> Self; fn decompress(packed: &Array) -> Result; fn compress(&self) -> Array; fn x_coordinate(&self) -> Array; }