primeorder/
lib.rs
1#![no_std]
2#![cfg_attr(docsrs, feature(doc_auto_cfg))]
3#![doc(
4 html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg",
5 html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg"
6)]
7#![forbid(unsafe_code)]
8#![warn(missing_docs, rust_2018_idioms, unused_qualifications)]
9#![doc = include_str!("../README.md")]
10
11#[cfg(feature = "alloc")]
12#[macro_use]
13extern crate alloc;
14
15pub mod point_arithmetic;
16
17mod affine;
18#[cfg(feature = "dev")]
19mod dev;
20mod field;
21mod projective;
22
23pub use crate::{affine::AffinePoint, projective::ProjectivePoint};
24pub use elliptic_curve::{
25 self, generic_array, point::Double, Field, FieldBytes, PrimeCurve, PrimeField,
26};
27
28use elliptic_curve::CurveArithmetic;
29
30pub trait PrimeCurveParams:
33 PrimeCurve
34 + CurveArithmetic
35 + CurveArithmetic<AffinePoint = AffinePoint<Self>>
36 + CurveArithmetic<ProjectivePoint = ProjectivePoint<Self>>
37{
38 type FieldElement: PrimeField<Repr = FieldBytes<Self>>;
41
42 type PointArithmetic: point_arithmetic::PointArithmetic<Self>;
44
45 const EQUATION_A: Self::FieldElement;
47
48 const EQUATION_B: Self::FieldElement;
50
51 const GENERATOR: (Self::FieldElement, Self::FieldElement);
53}