Struct p256::NistP256[][src]

pub struct NistP256;
Expand description

NIST P-256 elliptic curve.

This curve is also known as prime256v1 (ANSI X9.62) and secp256r1 (SECG) and is specified in FIPS 186-4: Digital Signature Standard (DSS):

https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf

It’s included in the US National Security Agency’s “Suite B” and is widely used in protocols like TLS and the associated X.509 PKI.

Its equation is y² = x³ - 3x + b over a ~256-bit prime field where b is the “verifiably random”† constant:

b = 41058363725152142129326129780047268409114441015993725554835256314039467401291

NOTE: the specific origins of this constant have never been fully disclosed (it is the SHA-1 digest of an inexplicable NSA-selected constant)

Trait Implementations

Elliptic curve point in affine coordinates.

Object Identifier (OID) for this curve

Get the pkcs8::AlgorithmIdentifier for this curve

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

256-bit field modulus

Curve order

Formats the value using the given formatter. Read more

Attempt to decompress an elliptic curve point.

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

This is supported on crate features ecdsa-core and sha256 only.

Preferred digest to use when computing ECDSA signatures for this elliptic curve. This should be a member of the SHA-2 family. Read more

This is supported on crate feature digest only.

Convert the output of a digest algorithm into a Scalar reduced modulo n.

Attempts to parse the given EncodedPoint as an SEC1-encoded AffinePoint.

Returns

None value if encoded_point is not on the secp256r1 curve.

Deserialize the type this trait is impl’d on from an EncodedPoint. Read more

This is supported on crate feature jwk only.

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

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

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

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

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

NIST P-256 points are typically uncompressed.

Elliptic curve point in projective coordinates. Read more

Scalar field type. Read more

This is supported on crate feature ecdsa-core only.

Try to sign the prehashed message. Read more

Serialize this value as a SEC1 EncodedPoint, optionally applying point compression. Read more

Serialize this value as a SEC1 EncodedPoint, optionally applying point compression. Read more

This is supported on crate feature ecdsa-core only.

Verify the prehashed message against the provided signature Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Performs the conversion.

Performs the conversion.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Should always be Self

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.