pub struct NistP256;
Available on crate feature
signature
only.Expand description
NIST P-256 elliptic curve.
This curve is also known as prime256v1 (ANSI X9.62) and secp256r1 (SECG) and is specified in NIST SP 800-186: Recommendations for Discrete Logarithm-based Cryptography: Elliptic Curve Domain Parameters.
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 unknown NSA-selected constant)
Trait Implementations§
source§impl Curve for NistP256
impl Curve for NistP256
source§impl CurveAlg for NistP256
impl CurveAlg for NistP256
source§fn signing_alg() -> &'static EcdsaSigningAlgorithm
fn signing_alg() -> &'static EcdsaSigningAlgorithm
ring signing algorithm
source§fn verify_alg() -> &'static EcdsaVerificationAlgorithm
fn verify_alg() -> &'static EcdsaVerificationAlgorithm
ring verify algorithm
source§impl Ord for NistP256
impl Ord for NistP256
source§impl PartialEq for NistP256
impl PartialEq for NistP256
source§impl PartialOrd for NistP256
impl PartialOrd for NistP256
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl PointCompaction for NistP256
impl PointCompaction for NistP256
source§const COMPACT_POINTS: bool = false
const COMPACT_POINTS: bool = false
NIST P-256 points are typically uncompressed.
source§impl PointCompression for NistP256
impl PointCompression for NistP256
source§const COMPRESS_POINTS: bool = false
const COMPRESS_POINTS: bool = false
NIST P-256 points are typically uncompressed.
source§impl ValidatePublicKey for NistP256
Available on non-crate feature arithmetic
only.
impl ValidatePublicKey for NistP256
Available on non-crate feature
arithmetic
only.§fn validate_public_key(
secret_key: &SecretKey<Self>,
public_key: &EncodedPoint<Self::FieldBytesSize>
) -> Result<(), Error>
fn validate_public_key( secret_key: &SecretKey<Self>, public_key: &EncodedPoint<Self::FieldBytesSize> ) -> Result<(), Error>
Validate that the given [
EncodedPoint
] is a valid public key for the
provided secret value.impl Copy for NistP256
impl Eq for NistP256
impl PrimeCurve for NistP256
impl StructuralEq for NistP256
impl StructuralPartialEq for NistP256
Auto Trait Implementations§
impl RefUnwindSafe for NistP256
impl Send for NistP256
impl Sync for NistP256
impl Unpin for NistP256
impl UnwindSafe for NistP256
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