[][src]Struct p256::NistP256

pub struct NistP256;

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

impl Clone for NistP256[src]

impl Compression for NistP256[src]

const COMPRESS_POINTS: bool[src]

NIST P-256 points are typically uncompressed.

impl Curve for NistP256[src]

impl Curve for NistP256[src]

type FieldSize = U32

256-bit (32-byte)

impl Debug for NistP256[src]

impl Decompress<NistP256> for AffinePoint[src]

impl Default for NistP256[src]

impl DigestPrimitive for NistP256[src]

type Digest = Sha256

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

impl Eq for NistP256[src]

impl FromDigest<NistP256> for Scalar[src]

fn from_digest<D>(digest: D) -> Self where
    D: Digest<OutputSize = U32>, 
[src]

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

impl FromEncodedPoint<NistP256> for AffinePoint[src]

fn from_encoded_point(encoded_point: &EncodedPoint) -> CtOption<Self>[src]

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

Returns

None value if encoded_point is not on the secp256r1 curve.

impl Identifier for NistP256[src]

impl Ord for NistP256[src]

impl PartialEq<NistP256> for NistP256[src]

impl PartialOrd<NistP256> for NistP256[src]

impl ProjectiveArithmetic for NistP256[src]

type ProjectivePoint = ProjectivePoint

Elliptic curve point in projective coordinates.

impl SignPrimitive<NistP256> for Scalar[src]

impl StructuralEq for NistP256[src]

impl StructuralPartialEq for NistP256[src]

impl ToEncodedPoint<NistP256> for AffinePoint[src]

impl VerifyPrimitive<NistP256> for AffinePoint[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<C> CheckSignatureBytes for C where
    C: Curve + ProjectiveArithmetic,
    GenericArray<u8, <C as Curve>::FieldSize>: From<<<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar>,
    GenericArray<u8, <C as Curve>::FieldSize>: for<'a> From<&'a <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar>,
    <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar: PrimeField,
    <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output: ArrayLength<u8>,
    <<<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar as PrimeField>::Repr == GenericArray<u8, <C as Curve>::FieldSize>, 
[src]

fn check_signature_bytes(
    bytes: &GenericArray<u8, <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output>
) -> Result<(), Error>
[src]

When curve arithmetic is available, check that the scalar components of the signature are in range.

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<C> SecretValue for C where
    C: Curve + ProjectiveArithmetic,
    GenericArray<u8, <C as Curve>::FieldSize>: From<<<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar>,
    GenericArray<u8, <C as Curve>::FieldSize>: for<'a> From<&'a <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar>,
    <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar: PrimeField,
    <<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar: Zeroize,
    <<<C as ProjectiveArithmetic>::ProjectivePoint as Group>::Scalar as PrimeField>::Repr == GenericArray<u8, <C as Curve>::FieldSize>, 
[src]

type Secret = NonZeroScalar<C>

Inner secret value. Read more

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.