pub struct RustCryptoCurve<C, X> { /* private fields */ }
Available on crate feature
rust-crypto
only.Expand description
Curve ported from elliptic_curve
crate
Implementations§
Source§impl<C, X> RustCryptoCurve<C, X>where
C: CurveArithmetic,
impl<C, X> RustCryptoCurve<C, X>where
C: CurveArithmetic,
Sourcepub fn point(point: C::ProjectivePoint) -> RustCryptoPoint<C>
pub fn point(point: C::ProjectivePoint) -> RustCryptoPoint<C>
Constructs a point on the curve
Source§impl<C, X> RustCryptoCurve<C, X>where
C: CurveArithmetic,
impl<C, X> RustCryptoCurve<C, X>where
C: CurveArithmetic,
Sourcepub fn scalar(scalar: C::Scalar) -> RustCryptoScalar<C>
pub fn scalar(scalar: C::Scalar) -> RustCryptoScalar<C>
Constructs a scalar
Trait Implementations§
Source§impl<C, X> Clone for RustCryptoCurve<C, X>
impl<C, X> Clone for RustCryptoCurve<C, X>
Source§impl<C, X> Curve for RustCryptoCurve<C, X>where
C: CurveName + CurveArithmetic,
C::ProjectivePoint: From<C::AffinePoint> + CofactorGroup + Copy + Eq + Default + ConstantTimeEq + ConditionallySelectable + Zeroize + Unpin,
C::AffinePoint: From<C::ProjectivePoint> + ToEncodedPoint<C> + FromEncodedPoint<C>,
for<'a> &'a C::ProjectivePoint: Mul<&'a C::Scalar, Output = C::ProjectivePoint>,
C::Scalar: Reduce<C::Uint> + Eq + ConstantTimeEq + ConditionallySelectable + DefaultIsZeroes + Unpin,
RustCryptoScalar<C>: BytesModOrder,
for<'a> ScalarPrimitive<C>: From<&'a C::Scalar>,
FieldBytesSize<C>: ModulusSize,
X: 'static,
impl<C, X> Curve for RustCryptoCurve<C, X>where
C: CurveName + CurveArithmetic,
C::ProjectivePoint: From<C::AffinePoint> + CofactorGroup + Copy + Eq + Default + ConstantTimeEq + ConditionallySelectable + Zeroize + Unpin,
C::AffinePoint: From<C::ProjectivePoint> + ToEncodedPoint<C> + FromEncodedPoint<C>,
for<'a> &'a C::ProjectivePoint: Mul<&'a C::Scalar, Output = C::ProjectivePoint>,
C::Scalar: Reduce<C::Uint> + Eq + ConstantTimeEq + ConditionallySelectable + DefaultIsZeroes + Unpin,
RustCryptoScalar<C>: BytesModOrder,
for<'a> ScalarPrimitive<C>: From<&'a C::Scalar>,
FieldBytesSize<C>: ModulusSize,
X: 'static,
Source§const CURVE_NAME: &'static str = C::CURVE_NAME
const CURVE_NAME: &'static str = C::CURVE_NAME
Curve name
Source§type Point = RustCryptoPoint<C>
type Point = RustCryptoPoint<C>
Type that represents a curve point
Source§type Scalar = RustCryptoScalar<C>
type Scalar = RustCryptoScalar<C>
Type that represents a curve scalar
Source§type CompressedPointArray = <<RustCryptoCurve<C, X> as Curve>::Point as CompressedEncoding>::Bytes
type CompressedPointArray = <<RustCryptoCurve<C, X> as Curve>::Point as CompressedEncoding>::Bytes
Byte array that fits the whole bytes representation of compressed point
Source§type UncompressedPointArray = <<RustCryptoCurve<C, X> as Curve>::Point as UncompressedEncoding>::Bytes
type UncompressedPointArray = <<RustCryptoCurve<C, X> as Curve>::Point as UncompressedEncoding>::Bytes
Byte array that fits the whole bytes representation of uncompressed point
Source§type ScalarArray = <<RustCryptoCurve<C, X> as Curve>::Scalar as IntegerEncoding>::Bytes
type ScalarArray = <<RustCryptoCurve<C, X> as Curve>::Scalar as IntegerEncoding>::Bytes
Byte array that fits the whole bytes representation of a scalar
Source§type CoordinateArray = GenericArray<u8, <C as Curve>::FieldBytesSize>
type CoordinateArray = GenericArray<u8, <C as Curve>::FieldBytesSize>
Byte array that fits the whole bytes representation of a coordinate Read more
Source§impl<C: CurveName, X> Debug for RustCryptoCurve<C, X>
impl<C: CurveName, X> Debug for RustCryptoCurve<C, X>
Source§impl<C, X> Default for RustCryptoCurve<C, X>
impl<C, X> Default for RustCryptoCurve<C, X>
Source§impl<C, X> HasAffineX for RustCryptoCurve<C, X>where
C: CurveArithmetic,
FieldBytesSize<C>: ModulusSize,
C::AffinePoint: ToEncodedPoint<C> + From<C::ProjectivePoint>,
RustCryptoCurve<C, X>: Curve<Point = RustCryptoPoint<C>, CoordinateArray = FieldBytes<C>>,
impl<C, X> HasAffineX for RustCryptoCurve<C, X>where
C: CurveArithmetic,
FieldBytesSize<C>: ModulusSize,
C::AffinePoint: ToEncodedPoint<C> + From<C::ProjectivePoint>,
RustCryptoCurve<C, X>: Curve<Point = RustCryptoPoint<C>, CoordinateArray = FieldBytes<C>>,
Source§impl<C, X> HasAffineXAndParity for RustCryptoCurve<C, X>where
C: CurveArithmetic,
FieldBytesSize<C>: ModulusSize,
C::AffinePoint: ToEncodedPoint<C> + FromEncodedPoint<C> + From<C::ProjectivePoint> + Into<C::ProjectivePoint>,
RustCryptoCurve<C, X>: Curve<Point = RustCryptoPoint<C>, CoordinateArray = FieldBytes<C>>,
impl<C, X> HasAffineXAndParity for RustCryptoCurve<C, X>where
C: CurveArithmetic,
FieldBytesSize<C>: ModulusSize,
C::AffinePoint: ToEncodedPoint<C> + FromEncodedPoint<C> + From<C::ProjectivePoint> + Into<C::ProjectivePoint>,
RustCryptoCurve<C, X>: Curve<Point = RustCryptoPoint<C>, CoordinateArray = FieldBytes<C>>,
Source§fn x_and_parity(point: &Self::Point) -> Option<(Self::CoordinateArray, Parity)>
fn x_and_parity(point: &Self::Point) -> Option<(Self::CoordinateArray, Parity)>
Returns point x coordinate and parity of y coordinate Read more
Source§fn from_x_and_parity(
x: &Self::CoordinateArray,
y_parity: Parity,
) -> Option<Self::Point>
fn from_x_and_parity( x: &Self::CoordinateArray, y_parity: Parity, ) -> Option<Self::Point>
Construct a point from x coordinate and parity of y coordinate Read more
Source§impl<C, X> HasAffineXY for RustCryptoCurve<C, X>where
C: CurveArithmetic,
FieldBytesSize<C>: ModulusSize,
C::AffinePoint: ToEncodedPoint<C> + FromEncodedPoint<C> + From<C::ProjectivePoint> + Into<C::ProjectivePoint>,
RustCryptoCurve<C, X>: Curve<Point = RustCryptoPoint<C>, CoordinateArray = FieldBytes<C>>,
impl<C, X> HasAffineXY for RustCryptoCurve<C, X>where
C: CurveArithmetic,
FieldBytesSize<C>: ModulusSize,
C::AffinePoint: ToEncodedPoint<C> + FromEncodedPoint<C> + From<C::ProjectivePoint> + Into<C::ProjectivePoint>,
RustCryptoCurve<C, X>: Curve<Point = RustCryptoPoint<C>, CoordinateArray = FieldBytes<C>>,
Source§fn x_and_y(
point: &Self::Point,
) -> Option<(Self::CoordinateArray, Self::CoordinateArray)>
fn x_and_y( point: &Self::Point, ) -> Option<(Self::CoordinateArray, Self::CoordinateArray)>
Returns point affine x and y coordinates Read more
Source§fn from_x_and_y(
x: &Self::CoordinateArray,
y: &Self::CoordinateArray,
) -> Option<Self::Point>
fn from_x_and_y( x: &Self::CoordinateArray, y: &Self::CoordinateArray, ) -> Option<Self::Point>
Construct a point from x and y coordinates Read more
Source§impl<C, X> HasAffineY for RustCryptoCurve<C, X>where
C: CurveArithmetic,
FieldBytesSize<C>: ModulusSize,
C::AffinePoint: ToEncodedPoint<C> + From<C::ProjectivePoint>,
RustCryptoCurve<C, X>: Curve<Point = RustCryptoPoint<C>, CoordinateArray = FieldBytes<C>>,
impl<C, X> HasAffineY for RustCryptoCurve<C, X>where
C: CurveArithmetic,
FieldBytesSize<C>: ModulusSize,
C::AffinePoint: ToEncodedPoint<C> + From<C::ProjectivePoint>,
RustCryptoCurve<C, X>: Curve<Point = RustCryptoPoint<C>, CoordinateArray = FieldBytes<C>>,
Source§impl<C, X> Hash for RustCryptoCurve<C, X>where
C: CurveName,
impl<C, X> Hash for RustCryptoCurve<C, X>where
C: CurveName,
Source§impl<C, X> Ord for RustCryptoCurve<C, X>
impl<C, X> Ord for RustCryptoCurve<C, X>
Source§impl<C, X> PartialEq for RustCryptoCurve<C, X>
impl<C, X> PartialEq for RustCryptoCurve<C, X>
Source§impl<C, X> PartialOrd for RustCryptoCurve<C, X>
impl<C, X> PartialOrd for RustCryptoCurve<C, X>
impl<C, X> Copy for RustCryptoCurve<C, X>
impl<C, X> Eq for RustCryptoCurve<C, X>
Auto Trait Implementations§
impl<C, X> Freeze for RustCryptoCurve<C, X>
impl<C, X> RefUnwindSafe for RustCryptoCurve<C, X>
impl<C, X> Send for RustCryptoCurve<C, X>
impl<C, X> Sync for RustCryptoCurve<C, X>
impl<C, X> Unpin for RustCryptoCurve<C, X>
impl<C, X> UnwindSafe for RustCryptoCurve<C, X>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more