pub trait Ec {
const MAX_SCALAR_LENGTH: usize;
type PrimitivesP256: EcPrimitives<P256>;
type PrimitivesX25519: EcPrimitives<X25519>;
type PrimitivesX448: EcPrimitives<X448>;
fn p256(&mut self) -> &mut Self::PrimitivesP256;
fn x25519(&mut self) -> &mut Self::PrimitivesX25519;
fn x448(&mut self) -> &mut Self::PrimitivesX448;
}
pub trait EcPrimitives<C: Curve> {
const HAS_MULTIPLY_SCALAR_POINT: bool;
type Scalar;
type Point;
fn multiply_scalar_point(&mut self, a: &Self::Scalar, b: &Self::Point) -> Self::Point;
fn import_scalar_bytes(&mut self, scalar: &[u8]) -> Result<Self::Scalar, crate::ImportError>;
fn point(&mut self, x: Self::Scalar, y: Self::Scalar) -> Self::Point;
fn export_scalar_bytes<'s>(
&mut self,
scalar: &'s Self::Scalar,
) -> impl AsRef<[u8]> + use<'s, C, Self>;
fn x_coord(&mut self, point: &Self::Point) -> Self::Scalar;
fn y_coord(&mut self, point: &Self::Point) -> Self::Scalar;
}
pub trait Curve {}
pub struct P256(());
impl Curve for P256 {}
pub struct X25519(());
impl Curve for X25519 {}
pub struct X448(());
impl Curve for X448 {}