Struct p521::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) -> NistP521

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Curve for NistP521

§

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

66-byte serialized field elements.

§

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

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

source§

const ORDER: U576 = _

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

source§

impl CurveArithmetic for NistP521

Available on crate feature arithmetic only.
§

type AffinePoint = AffinePoint<NistP521>

Elliptic curve point in affine coordinates.
§

type ProjectivePoint = ProjectivePoint<NistP521>

Elliptic curve point in projective coordinates. Read more
§

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() -> NistP521

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

impl FieldBytesEncoding<NistP521> for U576

source§

fn decode_field_bytes( field_bytes: &GenericArray<u8, <C as Curve>::FieldBytesSize> ) -> Self

Decode unsigned integer from serialized field element. Read more
source§

fn encode_field_bytes(&self) -> GenericArray<u8, <C as Curve>::FieldBytesSize>

Encode unsigned integer into serialized field element. Read more
source§

impl GroupDigest for NistP521

Available on crate features hash2curve and arithmetic only.
§

type FieldElement = FieldElement

The field element representation for a group value with multiple elements
source§

fn hash_from_bytes<'a, X>( msgs: &[&[u8]], dsts: &'a [&'a [u8]] ) -> Result<Self::ProjectivePoint, Error>
where X: ExpandMsg<'a>,

Computes the hash to curve routine. Read more
source§

fn encode_from_bytes<'a, X>( msgs: &[&[u8]], dsts: &'a [&'a [u8]] ) -> Result<Self::ProjectivePoint, Error>
where X: ExpandMsg<'a>,

Computes the encode to curve routine. Read more
source§

fn hash_to_scalar<'a, X>( msgs: &[&[u8]], dsts: &'a [&'a [u8]] ) -> Result<Self::Scalar, Error>
where X: ExpandMsg<'a>, Self::Scalar: FromOkm,

Computes the hash to field routine according to https://www.ietf.org/archive/id/draft-irtf-cfrg-hash-to-curve-13.html#section-5 and returns a scalar. Read more
source§

impl JwkParameters for NistP521

Available on crate feature jwk only.
source§

const CRV: &'static str = "P-521"

The crv parameter which identifies a particular elliptic curve as defined in RFC 7518 Section 6.2.1.1: https://tools.ietf.org/html/rfc7518#section-6.2.1.1 Read more
source§

impl Ord for NistP521

source§

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

This method returns an Ordering between self and other. Read more
1.21.0 · source§

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

Compares and returns the maximum of two values. Read more
1.21.0 · source§

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

Compares and returns the minimum of two values. Read more
1.50.0 · source§

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

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

impl PartialEq for NistP521

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for NistP521

source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method 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 PrimeCurveArithmetic for NistP521

Available on crate feature arithmetic only.
§

type CurveGroup = ProjectivePoint<NistP521>

Prime order elliptic curve group.
source§

impl PrimeCurveParams for NistP521

Available on crate feature arithmetic only.

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
§

type FieldElement = FieldElement

Base field element type.
§

type PointArithmetic = EquationAIsMinusThree

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

impl SignPrimitive<NistP521> for Scalar

Available on crate features ecdsa-core and ecdsa only.
source§

fn try_sign_prehashed<K>( &self, k: K, z: &GenericArray<u8, <C as Curve>::FieldBytesSize> ) -> Result<(Signature<C>, Option<RecoveryId>), Error>
where K: AsRef<Self> + Invert<Output = CtOption<Self>>,

Try to sign the prehashed message. Read more
source§

fn try_sign_prehashed_rfc6979<D>( &self, z: &GenericArray<u8, <C as Curve>::FieldBytesSize>, ad: &[u8] ) -> Result<(Signature<C>, Option<RecoveryId>), Error>
where Self: From<ScalarPrimitive<C>> + Invert<Output = CtOption<Self>>, D: Digest<OutputSize = <C as Curve>::FieldBytesSize> + BlockSizeUser + FixedOutput + FixedOutputReset,

Available on crate feature rfc6979 only.
Try to sign the given message digest deterministically using the method described in RFC6979 for computing ECDSA ephemeral scalar k. Read more
source§

impl VerifyPrimitive<NistP521> for AffinePoint

Available on crate features ecdsa-core and ecdsa only.
source§

fn verify_prehashed( &self, z: &GenericArray<u8, <C as Curve>::FieldBytesSize>, sig: &Signature<C> ) -> Result<(), Error>

Verify the prehashed message against the provided ECDSA signature. Read more
source§

fn verify_digest<D>( &self, msg_digest: D, sig: &Signature<C> ) -> Result<(), Error>
where D: FixedOutput<OutputSize = <C as Curve>::FieldBytesSize>,

Available on crate feature digest only.
Verify message digest against the provided signature.
source§

impl VoprfParameters for NistP521

Available on crate feature voprf only.
source§

impl Copy for NistP521

source§

impl Eq for NistP521

source§

impl PrimeCurve for NistP521

source§

impl StructuralEq for NistP521

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
§

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

§

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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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 EncodedPoint is a valid public key for the provided secret value.