pub trait Curve:
Debug
+ Copy
+ Eq
+ Ord
+ Hash
+ Default
+ Sync
+ Send
+ 'static {
type Point: Additive + From<CurveGenerator> + Zero + Zeroize + OnCurve + SmallFactor + Copy + Eq + ConstantTimeEq + ConditionallySelectable + Default + CompressedEncoding<Bytes = Self::CompressedPointArray> + UncompressedEncoding<Bytes = Self::UncompressedPointArray> + Decode + Unpin + Sync + Send;
type Scalar: Additive + Multiplicative<Self::Scalar, Output = Self::Scalar, Output = Self::Point, Output = Self::Point> + Multiplicative<CurveGenerator> + Multiplicative<Self::Point> + Invertible + Zero + One + Samplable + Zeroize + Copy + Eq + ConstantTimeEq + ConditionallySelectable + Default + IntegerEncoding<Bytes = Self::ScalarArray> + Unpin + Sync + Send;
type CompressedPointArray: ByteArray;
type UncompressedPointArray: ByteArray;
type ScalarArray: ByteArray;
type CoordinateArray: ByteArray;
const CURVE_NAME: &'static str;
}
Expand description
Elliptic curve
This trait contains all the low-level curve implementation logic: scalar, point arithmetics, encoding and etc.
Required Associated Constants§
Sourceconst CURVE_NAME: &'static str
const CURVE_NAME: &'static str
Curve name
Required Associated Types§
Sourcetype Point: Additive + From<CurveGenerator> + Zero + Zeroize + OnCurve + SmallFactor + Copy + Eq + ConstantTimeEq + ConditionallySelectable + Default + CompressedEncoding<Bytes = Self::CompressedPointArray> + UncompressedEncoding<Bytes = Self::UncompressedPointArray> + Decode + Unpin + Sync + Send
type Point: Additive + From<CurveGenerator> + Zero + Zeroize + OnCurve + SmallFactor + Copy + Eq + ConstantTimeEq + ConditionallySelectable + Default + CompressedEncoding<Bytes = Self::CompressedPointArray> + UncompressedEncoding<Bytes = Self::UncompressedPointArray> + Decode + Unpin + Sync + Send
Type that represents a curve point
Sourcetype Scalar: Additive + Multiplicative<Self::Scalar, Output = Self::Scalar, Output = Self::Point, Output = Self::Point> + Multiplicative<CurveGenerator> + Multiplicative<Self::Point> + Invertible + Zero + One + Samplable + Zeroize + Copy + Eq + ConstantTimeEq + ConditionallySelectable + Default + IntegerEncoding<Bytes = Self::ScalarArray> + Unpin + Sync + Send
type Scalar: Additive + Multiplicative<Self::Scalar, Output = Self::Scalar, Output = Self::Point, Output = Self::Point> + Multiplicative<CurveGenerator> + Multiplicative<Self::Point> + Invertible + Zero + One + Samplable + Zeroize + Copy + Eq + ConstantTimeEq + ConditionallySelectable + Default + IntegerEncoding<Bytes = Self::ScalarArray> + Unpin + Sync + Send
Type that represents a curve scalar
Sourcetype CompressedPointArray: ByteArray
type CompressedPointArray: ByteArray
Byte array that fits the whole bytes representation of compressed point
Sourcetype UncompressedPointArray: ByteArray
type UncompressedPointArray: ByteArray
Byte array that fits the whole bytes representation of uncompressed point
Sourcetype ScalarArray: ByteArray
type ScalarArray: ByteArray
Byte array that fits the whole bytes representation of a scalar
Sourcetype CoordinateArray: ByteArray
type CoordinateArray: ByteArray
Byte array that fits the whole bytes representation of a coordinate
If a curve doesn’t expose point coordinates, it may be [u8; 0]
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.