[−][src]Struct p256::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]
fn decompress(x_bytes: &FieldBytes, y_is_odd: Choice) -> CtOption<Self>
[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]
D: Digest<OutputSize = U32>,
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]
const OID: ObjectIdentifier
[src]
impl Ord for NistP256
[src]
fn cmp(&self, other: &NistP256) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<NistP256> for NistP256
[src]
impl PartialOrd<NistP256> for NistP256
[src]
fn partial_cmp(&self, other: &NistP256) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl ProjectiveArithmetic for NistP256
[src]
type ProjectivePoint = ProjectivePoint
Elliptic curve point in projective coordinates.
impl SignPrimitive<NistP256> for Scalar
[src]
fn try_sign_prehashed<K>(
&self,
ephemeral_scalar: &K,
z: &Scalar
) -> Result<Signature, Error> where
K: Borrow<Scalar> + Invert<Output = Scalar>,
[src]
&self,
ephemeral_scalar: &K,
z: &Scalar
) -> Result<Signature, Error> where
K: Borrow<Scalar> + Invert<Output = Scalar>,
impl StructuralEq for NistP256
[src]
impl StructuralPartialEq for NistP256
[src]
impl ToEncodedPoint<NistP256> for AffinePoint
[src]
fn to_encoded_point(&self, compress: bool) -> EncodedPoint
[src]
impl VerifyPrimitive<NistP256> for AffinePoint
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[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]
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>,
fn check_signature_bytes(
bytes: &GenericArray<u8, <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output>
) -> Result<(), Error>
[src]
bytes: &GenericArray<u8, <<C as Curve>::FieldSize as Add<<C as Curve>::FieldSize>>::Output>
) -> Result<(), Error>
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
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Self: Binary,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Self: Display,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Self: LowerExp,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Self: LowerHex,
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Self: Octal,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Self: Pointer,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Self: UpperExp,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Self: UpperHex,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pipe for T
impl<T> PipeAsRef for T
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
R: 'a,
Self: AsRef<T>,
T: 'a,
R: 'a,
Self: AsRef<T>,
T: 'a,
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
R: 'a,
Self: AsMut<T>,
T: 'a,
R: 'a,
Self: AsMut<T>,
T: 'a,
impl<T> PipeBorrow for T
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
R: 'a,
Self: Borrow<T>,
T: 'a,
R: 'a,
Self: Borrow<T>,
T: 'a,
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
R: 'a,
Self: BorrowMut<T>,
T: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
R: 'a,
Self: BorrowMut<T>,
T: 'a,
impl<T> PipeDeref for T
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
R: 'a,
Self: Deref,
R: 'a,
Self: Deref,
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
R: 'a,
Self: DerefMut,
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
R: 'a,
Self: DerefMut,
impl<T> PipeRef for T
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
R: 'a,
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]
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>,
type Secret = NonZeroScalar<C>
Inner secret value. Read more
fn from_secret_bytes(
repr: &GenericArray<u8, <C as Curve>::FieldSize>
) -> Option<NonZeroScalar<C>>
[src]
repr: &GenericArray<u8, <C as Curve>::FieldSize>
) -> Option<NonZeroScalar<C>>
impl<T> Tap for T
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
U: ?Sized,
fn tap_ref<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
fn tap_ref_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
U: ?Sized,
fn tap_borrow<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
impl<T> TapDeref for T
fn tap_deref<F, R>(self, func: F) -> Self where
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> TryConv for T
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,