Struct 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

Elliptic curve point in affine coordinates.

Object Identifier (OID) for this curve

Get the pkcs8::AlgorithmIdentifier for this curve

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

256-bit field modulus

Curve order

Formats the value using the given formatter. Read more

Attempt to decompress an elliptic curve point.

Returns the “default value” for a type. Read more

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

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

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

Returns

None value if encoded_point is not on the secp256k1 curve.

Deserialize the type this trait is impl’d on from an EncodedPoint. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

secp256k1 points are typically compressed.

Elliptic curve point in projective coordinates. Read more

Try to sign the prehashed message. Read more

Scalar field type. 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

Verify the prehashed message against the provided signature Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.