Skip to main content

P521

Struct P521 

Source
pub struct P521;
Expand description

The P-521 curve.

Trait Implementations§

Source§

impl Clone for P521

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for P521

Source§

impl Curve for P521

Source§

const FIELD_BYTES: usize = 66

521 bits rounds up to 66 bytes, with the top seven bits of the first byte always zero.

Source§

const ORDER_BITS: usize = 521

521, not 528. The seven-bit gap is what makes RFC 6979’s bits2int shift here where it does not for the other curves.

Source§

const B: Fp

b = 0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef1 09e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00

Source§

fn sqrt(x: &Fp) -> Fp

(p + 1) / 4 = 2^519, so the square root is a chain of squarings.

The other curves compute the exponent from the modulus and run square-and-multiply. Here the exponent is a power of two, so every multiply in that loop would be by one.

Source§

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

Display name, e.g. "P-256".
Source§

const SCALAR_BYTES: usize = 66

Width of an encoded scalar.
Source§

const GX: Fp

The base point x-coordinate.
Source§

const GY: Fp

The base point y-coordinate.
Source§

type Field = Fp

The coordinate field, GF(p).
Source§

type Scalar = Fn

The scalar ring, Z/nZ.
Source§

fn field_from_slice(bytes: &[u8]) -> Option<Fp>

Decode a field element from exactly Self::FIELD_BYTES bytes.
Source§

fn scalar_from_slice(bytes: &[u8]) -> Option<Fn>

Decode a scalar from exactly Self::SCALAR_BYTES bytes, rejecting a non-canonical encoding.
Source§

fn scalar_reduce_slice(bytes: &[u8]) -> Fn

Decode a scalar, reducing rather than rejecting. Read more
Source§

impl Debug for P521

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl EcdsaCurve for P521

Source§

const SIGNATURE_ID: &'static str = "ecdsa-p521-sha512"

The ontology identifier of this signature scheme.
Source§

type Digest = Sha512

The message digest, at the curve’s security level.
Source§

type Hmac = Hmac<Sha512>

HMAC over the same digest, for RFC 6979.
Source§

impl HasGeneratorTable for P521

Source§

fn mul_generator(scalar: &<Self as Curve>::Scalar) -> Point<Self>

scalar * G.

Auto Trait Implementations§

§

impl Freeze for P521

§

impl RefUnwindSafe for P521

§

impl Send for P521

§

impl Sync for P521

§

impl Unpin for P521

§

impl UnsafeUnpin for P521

§

impl UnwindSafe for P521

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
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.