Skip to main content
This is unreleased documentation for the main (development) branch of crypto-glue.

NistP521

Struct NistP521 

Source
pub struct NistP521;
Expand description

NIST P-521 elliptic curve.

Trait Implementations§

Source§

impl AssociatedOid for NistP521

Available on crate feature pkcs8 only.
Source§

const OID: ObjectIdentifier

The OID associated with this type.
Source§

impl Clone for NistP521

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for NistP521

Source§

impl Curve for NistP521

Source§

const ORDER: Odd<Uint>

Order of NIST P-521’s elliptic curve group (i.e. scalar modulus).

Source§

type FieldBytesSize = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B1>, B0>

66-byte serialized field elements.

Source§

type Uint = Uint<crypto_bigint::::uint::U576::{constant#0}>

521-bit integer type used for internally representing field elements.

Source§

const FIELD_ENDIANNESS: ByteOrder = ByteOrder::BigEndian

Endianness used for serializing field elements of this curve.
Source§

impl CurveArithmetic for NistP521

Source§

type AffinePoint = AffinePoint<NistP521>

Elliptic curve point in affine coordinates.
Source§

type ProjectivePoint = ProjectivePoint<NistP521>

Elliptic curve point in projective coordinates. Read more
Source§

type Scalar = Scalar

Scalar field modulo this curve’s order. Read more
Source§

impl Debug for NistP521

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NistP521

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl DigestAlgorithm for NistP521

Available on crate feature sha512 only.
Source§

type Digest = Sha512

Preferred digest to use when computing ECDSA signatures for this elliptic curve. This is typically a member of the SHA-2 family.
Source§

impl EcdsaCurve for NistP521

Source§

const NORMALIZE_S: bool = false

Does this curve use low-S normalized signatures? Read more
Source§

impl Eq for NistP521

Source§

impl FieldArithmetic for NistP521

Source§

type FieldElement = FieldElement

Base field element type.
Source§

impl Mul<&<NistP521 as CurveArithmetic>::AffinePoint> for Scalar

Source§

type Output = <NistP521 as CurveArithmetic>::ProjectivePoint

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &AffinePoint<NistP521>) -> ProjectivePoint<NistP521>

Performs the * operation. Read more
Source§

impl Mul<&<NistP521 as CurveArithmetic>::AffinePoint> for &Scalar

Source§

type Output = <NistP521 as CurveArithmetic>::ProjectivePoint

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &AffinePoint<NistP521>) -> ProjectivePoint<NistP521>

Performs the * operation. Read more
Source§

impl Mul<&<NistP521 as CurveArithmetic>::ProjectivePoint> for Scalar

Source§

type Output = <NistP521 as CurveArithmetic>::ProjectivePoint

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &ProjectivePoint<NistP521>) -> ProjectivePoint<NistP521>

Performs the * operation. Read more
Source§

impl Mul<&<NistP521 as CurveArithmetic>::ProjectivePoint> for &Scalar

Source§

type Output = <NistP521 as CurveArithmetic>::ProjectivePoint

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &ProjectivePoint<NistP521>) -> ProjectivePoint<NistP521>

Performs the * operation. Read more
Source§

impl Mul<<NistP521 as CurveArithmetic>::AffinePoint> for Scalar

Source§

type Output = <NistP521 as CurveArithmetic>::ProjectivePoint

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: AffinePoint<NistP521>) -> ProjectivePoint<NistP521>

Performs the * operation. Read more
Source§

impl Mul<<NistP521 as CurveArithmetic>::AffinePoint> for &Scalar

Source§

type Output = <NistP521 as CurveArithmetic>::ProjectivePoint

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: AffinePoint<NistP521>) -> ProjectivePoint<NistP521>

Performs the * operation. Read more
Source§

impl Mul<<NistP521 as CurveArithmetic>::ProjectivePoint> for Scalar

Source§

type Output = <NistP521 as CurveArithmetic>::ProjectivePoint

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: ProjectivePoint<NistP521>) -> ProjectivePoint<NistP521>

Performs the * operation. Read more
Source§

impl Mul<<NistP521 as CurveArithmetic>::ProjectivePoint> for &Scalar

Source§

type Output = <NistP521 as CurveArithmetic>::ProjectivePoint

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: ProjectivePoint<NistP521>) -> ProjectivePoint<NistP521>

Performs the * operation. Read more
Source§

impl MulVartime<&<NistP521 as CurveArithmetic>::AffinePoint> for Scalar

Source§

fn mul_vartime(self, rhs: &AffinePoint<NistP521>) -> ProjectivePoint<NistP521>

Multiply self by rhs in variable-time.
Source§

impl MulVartime<&<NistP521 as CurveArithmetic>::AffinePoint> for &Scalar

Source§

fn mul_vartime(self, rhs: &AffinePoint<NistP521>) -> ProjectivePoint<NistP521>

Multiply self by rhs in variable-time.
Source§

impl MulVartime<&<NistP521 as CurveArithmetic>::ProjectivePoint> for Scalar

Source§

fn mul_vartime( self, rhs: &ProjectivePoint<NistP521>, ) -> ProjectivePoint<NistP521>

Multiply self by rhs in variable-time.
Source§

impl MulVartime<&<NistP521 as CurveArithmetic>::ProjectivePoint> for &Scalar

Source§

fn mul_vartime( self, rhs: &ProjectivePoint<NistP521>, ) -> ProjectivePoint<NistP521>

Multiply self by rhs in variable-time.
Source§

impl MulVartime<<NistP521 as CurveArithmetic>::AffinePoint> for Scalar

Source§

fn mul_vartime(self, rhs: AffinePoint<NistP521>) -> ProjectivePoint<NistP521>

Multiply self by rhs in variable-time.
Source§

impl MulVartime<<NistP521 as CurveArithmetic>::AffinePoint> for &Scalar

Source§

fn mul_vartime(self, rhs: AffinePoint<NistP521>) -> ProjectivePoint<NistP521>

Multiply self by rhs in variable-time.
Source§

impl MulVartime<<NistP521 as CurveArithmetic>::ProjectivePoint> for Scalar

Source§

fn mul_vartime( self, rhs: ProjectivePoint<NistP521>, ) -> ProjectivePoint<NistP521>

Multiply self by rhs in variable-time.
Source§

impl MulVartime<<NistP521 as CurveArithmetic>::ProjectivePoint> for &Scalar

Source§

fn mul_vartime( self, rhs: ProjectivePoint<NistP521>, ) -> ProjectivePoint<NistP521>

Multiply self by rhs in variable-time.
Source§

impl Ord for NistP521

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for NistP521

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for NistP521

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PointCompaction for NistP521

Source§

const COMPACT_POINTS: bool = false

NIST P-521 points are typically uncompacted.

Source§

impl PointCompression for NistP521

Source§

const COMPRESS_POINTS: bool = false

NIST P-521 points are typically uncompressed.

Source§

impl PrimeCurve for NistP521

Source§

impl PrimeCurveArithmetic for NistP521

Source§

type CurveGroup = ProjectivePoint<NistP521>

Prime order elliptic curve group.
Source§

impl PrimeCurveParams for NistP521

Adapted from NIST SP 800-186 § 3.2.1.5: P-521.

Source§

const EQUATION_A: FieldElement

a = -3 (0x1ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc)

Source§

const EQUATION_B: FieldElement

b = 0x051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00

Source§

const GENERATOR: (FieldElement, FieldElement)

Base point of P-521.

Gₓ = 0x0c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521
           f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de
           3348b3c1 856a429b f97e7e31 c2e5bd66
Gᵧ = 0x118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468
           17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761
           353c7086 a272c240 88be9476 9fd16650
Source§

type PointArithmetic = EquationAIsMinusThree

Point arithmetic implementation, might be optimized for this specific curve
Source§

type Backend = PrecomputedTables

Scalar arithmetic backend implementation.
Source§

impl PrimeCurveWithBasepointTable<WINDOW_SIZE> for NistP521

Source§

const BASEPOINT_TABLE: &'static BasepointTable<ProjectivePoint, WINDOW_SIZE>

Basepoint table for this curve.
Source§

impl StructuralPartialEq for NistP521

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynAssociatedOid for T
where T: AssociatedOid,

Source§

fn oid(&self) -> ObjectIdentifier

Get the OID associated with this value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<C> ValidatePublicKey for C

Source§

fn validate_public_key( secret_key: &SecretKey<C>, public_key: &EncodedPoint<<C as Curve>::FieldBytesSize>, ) -> Result<(), Error>

Validate that the given Sec1Point is a valid public key for the provided secret value. Read more