Struct ethers::core::k256::Secp256k1 [−][src]
pub struct Secp256k1;
Expand description
K-256 (secp256k1) elliptic curve.
Specified in Certicom’s SECG in “SEC 2: Recommended Elliptic Curve Domain Parameters”:
https://www.secg.org/sec2-v2.pdf
The curve’s equation is y² = x³ + 7
over a ~256-bit prime field.
It’s primarily notable for usage in Bitcoin and other cryptocurrencies, particularly in conjunction with the Elliptic Curve Digital Signature Algorithm (ECDSA).
Trait Implementations
type AffinePoint = AffinePoint
type AffinePoint = AffinePoint
Elliptic curve point in affine coordinates.
Object Identifier (OID) for this curve
Get the pkcs8::AlgorithmIdentifier
for this curve
YubiHSM asymmetric algorithm for this elliptic curve
pub fn decompress(
x_bytes: &GenericArray<u8, <<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>,
y_is_odd: Choice
) -> CtOption<AffinePoint>
pub fn decompress(
x_bytes: &GenericArray<u8, <<Secp256k1 as Curve>::UInt as ArrayEncoding>::ByteSize>,
y_is_odd: Choice
) -> CtOption<AffinePoint>
Attempt to decompress an elliptic curve point.
Deserialize the type this trait is impl’d on from an EncodedPoint
. Read more
Attempts to parse the given EncodedPoint
as an SEC1-encoded AffinePoint
.
Returns
None
value if encoded_point
is not on the secp256k1 curve.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
secp256k1 points are typically compressed.
type ProjectivePoint = ProjectivePoint
type ProjectivePoint = ProjectivePoint
Elliptic curve point in projective coordinates. Read more
Serialize this value as a SEC1 EncodedPoint
, optionally applying
point compression. Read more
Serialize this value as a SEC1 EncodedPoint
, optionally applying
point compression. Read more
Serialize this value as a SEC1 EncodedPoint
, optionally applying
point compression. Read more
Auto Trait Implementations
impl RefUnwindSafe for Secp256k1
impl UnwindSafe for Secp256k1
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more