Struct secp256k1_test::Signature [] [src]

pub struct Signature(_);

An ECDSA signature

Methods

impl Signature
[src]

[src]

Converts a DER-encoded byte slice to a signature

[src]

Converts a 64-byte compact-encoded byte slice to a signature

[src]

Converts a "lax DER"-encoded byte slice to a signature. This is basically only useful for validating signatures in the Bitcoin blockchain from before 2016. It should never be used in new applications. This library does not support serializing to this "format"

[src]

Normalizes a signature to a "low S" form. In ECDSA, signatures are of the form (r, s) where r and s are numbers lying in some finite field. The verification equation will pass for (r, s) iff it passes for (r, -s), so it is possible to ``modify'' signatures in transit by flipping the sign of s. This does not constitute a forgery since the signed message still cannot be changed, but for some applications, changing even the signature itself can be a problem. Such applications require a "strong signature". It is believed that ECDSA is a strong signature except for this ambiguity in the sign of s, so to accomodate these applications libsecp256k1 will only accept signatures for which s is in the lower half of the field range. This eliminates the ambiguity.

However, for some systems, signatures with high s-values are considered valid. (For example, parsing the historic Bitcoin blockchain requires this.) For these applications we provide this normalization function, which ensures that the s value lies in the lower half of its range.

[src]

Obtains a raw pointer suitable for use with FFI functions

[src]

Obtains a raw mutable pointer suitable for use with FFI functions

[src]

Serializes the signature in DER format

[src]

Serializes the signature in compact format

Trait Implementations

impl Copy for Signature
[src]

impl Clone for Signature
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for Signature
[src]

[src]

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

[src]

This method tests for !=.

impl Eq for Signature
[src]

impl Debug for Signature
[src]

[src]

Formats the value using the given formatter.

impl Serialize for Signature
[src]

[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for Signature
[src]

[src]

Deserialize this value from the given Serde deserializer. Read more

impl From<Signature> for Signature
[src]

Creates a new signature from a FFI signature

[src]

Performs the conversion.

impl Index<usize> for Signature
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl Index<Range<usize>> for Signature
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl Index<RangeFrom<usize>> for Signature
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl Index<RangeFull> for Signature
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.