elliptic_curve/
arithmetic.rs1use crate::{Curve, FieldBytes};
4use core::fmt::Debug;
5use subtle::{ConditionallySelectable, ConstantTimeEq};
6
7#[cfg_attr(docsrs, doc(cfg(feature = "arithmetic")))]
9pub trait AffineArithmetic: Curve + ScalarArithmetic {
10 type AffinePoint: Copy
12 + Clone
13 + ConditionallySelectable
14 + ConstantTimeEq
15 + Debug
16 + Default
17 + Sized
18 + Send
19 + Sync
20 + 'static;
21}
22
23#[cfg_attr(docsrs, doc(cfg(feature = "arithmetic")))]
25pub trait ProjectiveArithmetic: Curve + AffineArithmetic {
26 type ProjectivePoint: ConditionallySelectable
37 + ConstantTimeEq
38 + Default
39 + From<Self::AffinePoint>
40 + Into<Self::AffinePoint>
41 + group::Curve<AffineRepr = Self::AffinePoint>
42 + group::Group<Scalar = Self::Scalar>;
43}
44
45#[cfg(feature = "arithmetic")]
47#[cfg_attr(docsrs, doc(cfg(feature = "arithmetic")))]
48pub trait ScalarArithmetic: Curve {
49 type Scalar: ConstantTimeEq + ff::Field + ff::PrimeField<Repr = FieldBytes<Self>>;
60}