Trait Curve

Source
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§

Source

const CURVE_NAME: &'static str

Curve name

Required Associated Types§

Source

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

Source

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

Source

type CompressedPointArray: ByteArray

Byte array that fits the whole bytes representation of compressed point

Source

type UncompressedPointArray: ByteArray

Byte array that fits the whole bytes representation of uncompressed point

Source

type ScalarArray: ByteArray

Byte array that fits the whole bytes representation of a scalar

Source

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.

Implementations on Foreign Types§

Source§

impl<C, X> Curve for RustCryptoCurve<C, X>

Implementors§