Struct ecdsa::RecoveryId

source ·
pub struct RecoveryId(_);
Expand description

Recovery IDs, a.k.a. “recid”.

This is an integer value 0, 1, 2, or 3 included along with a signature which is used during the recovery process to select the correct public key from the signature.

It consists of two bits of information:

  • low bit (0/1): was the y-coordinate of the affine point resulting from the fixed-base multiplication 𝑘×𝑮 odd? This part of the algorithm functions similar to point decompression.
  • hi bit (3/4): did the affine x-coordinate of 𝑘×𝑮 overflow the order of the scalar field, requiring a reduction when computing r?

Implementations§

Maximum supported value for the recovery ID (inclusive).

Create a new RecoveryId from the following 1-bit arguments:

  • is_y_odd: is the affine y-coordinate of 𝑘×𝑮 odd?
  • is_x_reduced: did the affine x-coordinate of 𝑘×𝑮 overflow the curve order?

Did the affine x-coordinate of 𝑘×𝑮 overflow the curve order?

Is the affine y-coordinate of 𝑘×𝑮 odd?

Convert this RecoveryId into a u8.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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
The type returned in the event of a conversion error.
Performs the conversion.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.