short_weierstrass/
lib.rs

1#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2#![doc = include_str!("../README.md")]
3#![no_std]
4#![allow(non_snake_case)]
5
6use core::fmt::Debug;
7
8use zeroize::Zeroize;
9use group::ff::PrimeField;
10
11mod affine;
12pub use affine::Affine;
13mod projective;
14pub use projective::Projective;
15
16/// An elliptic curve represented in short Weierstrass form, with equation `y^2 = x^3 + A x + B`.
17pub trait ShortWeierstrass: 'static + Sized + Debug {
18  /// The field the elliptic curve is defined over.
19  type FieldElement: Zeroize + PrimeField;
20  /// The constant `A` from the curve equation.
21  const A: Self::FieldElement;
22  /// The constant `B` from the curve equation.
23  const B: Self::FieldElement;
24  /// A generator of this elliptic curve.
25  const GENERATOR: Affine<Self>;
26  /// The scalar type.
27  ///
28  /// This may be omitted by specifying `()`.
29  type Scalar;
30}