Struct ecdsa::Signature[][src]

pub struct Signature<C: Curve> where
    SignatureSize<C>: ArrayLength<u8>, 
{ /* fields omitted */ }
Expand description

ECDSA signature (fixed-size). Generic over elliptic curve types.

Serialized as fixed-sized big endian scalar values with no added framing:

  • r: field element size for the given curve, big-endian
  • s: field element size for the given curve, big-endian

For example, in a curve with a 256-bit modulus like NIST P-256 or secp256k1, r and s will both be 32-bytes, resulting in a signature with a total of 64-bytes.

ASN.1 DER-encoded signatures also supported via the Signature::from_der and Signature::to_der methods.

Implementations

Create a Signature from the serialized r and s scalar values which comprise the signature.

This is supported on crate feature der only.

Parse a signature from ASN.1 DER

This is supported on crate feature der only.

Serialize this signature as ASN.1 DER

This is supported on crate feature arithmetic only.

Get the r component of this signature

This is supported on crate feature arithmetic only.

Get the s component of this signature

This is supported on crate feature arithmetic only.

Normalize signature into “low S” form as described in BIP 0062: Dealing with Malleability.

Trait Implementations

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Sign message prehash using a deterministic ephemeral scalar (k) computed using the algorithm described in RFC 6979 (Section 3.2): https://tools.ietf.org/html/rfc6979#section-3

Sign the given prehashed message [Digest], returning a signature. Read more

Verify the signature against the given [Digest] output.

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

This method tests for !=.

Preferred Digest algorithm to use when computing this signature type.

Sign message prehash using an ephemeral scalar (k) derived according to a variant of RFC 6979 (Section 3.6) which supplies additional entropy from an RNG.

Sign the given prehashed message Digest, returning a signature. Read more

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong. Read more

Sign the given message and return a digital signature

Parse a signature from its byte representation

Borrow a byte slice representing the serialized form of this signature

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong. Read more

Sign the given message and return a digital signature

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.

Use Self to verify that the provided signature for a given message bytestring is authentic. 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.