pub struct P521;Expand description
The P-521 curve.
Trait Implementations§
impl Copy for P521
Source§impl Curve for P521
impl Curve for P521
Source§const FIELD_BYTES: usize = 66
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
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
const B: Fp
b = 0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef1
09e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00
Source§fn sqrt(x: &Fp) -> Fp
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 SCALAR_BYTES: usize = 66
const SCALAR_BYTES: usize = 66
Width of an encoded scalar.
Source§fn field_from_slice(bytes: &[u8]) -> Option<Fp>
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>
fn scalar_from_slice(bytes: &[u8]) -> Option<Fn>
Decode a scalar from exactly
Self::SCALAR_BYTES bytes, rejecting a
non-canonical encoding.Source§impl EcdsaCurve for P521
impl EcdsaCurve for P521
Source§impl HasGeneratorTable for P521
impl HasGeneratorTable for P521
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> 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