mod non_identity;
#[cfg(feature = "arithmetic")]
pub use self::non_identity::NonIdentity;
use crate::{Curve, FieldBytes};
use subtle::{Choice, CtOption};
#[cfg(feature = "arithmetic")]
use crate::CurveArithmetic;
#[cfg(feature = "arithmetic")]
pub type AffinePoint<C> = <C as CurveArithmetic>::AffinePoint;
#[cfg(feature = "arithmetic")]
pub type ProjectivePoint<C> = <C as CurveArithmetic>::ProjectivePoint;
pub trait AffineCoordinates: Sized {
type FieldRepr: AsRef<[u8]>;
fn from_coordinates(x: &Self::FieldRepr, y: &Self::FieldRepr) -> CtOption<Self>;
fn x(&self) -> Self::FieldRepr;
fn y(&self) -> Self::FieldRepr;
fn x_is_odd(&self) -> Choice;
fn y_is_odd(&self) -> Choice;
}
#[cfg(feature = "arithmetic")]
pub trait BatchNormalize<Points: ?Sized> {
type Output;
fn batch_normalize(points: &Points) -> Self::Output;
fn batch_normalize_vartime(points: &Points) -> Self::Output {
Self::batch_normalize(points)
}
}
pub trait DecompressPoint<C: Curve>: Sized {
fn decompress(x: &FieldBytes<C>, y_is_odd: Choice) -> CtOption<Self>;
}
pub trait DecompactPoint<C: Curve>: Sized {
fn decompact(x: &FieldBytes<C>) -> CtOption<Self>;
}
pub trait PointCompression {
const COMPRESS_POINTS: bool;
}
pub trait PointCompaction {
const COMPACT_POINTS: bool;
}