Expand description
Structs and functionality related to the ECDSA signature algorithm.
Re-exports§
pub use self::serialized_signature::SerializedSignature;
Modules§
- serialized_
signature - Implements
SerializedSignatureand related types.
Structs§
- Signature
- An ECDSA signature
Functions§
- sign
- Constructs a signature for
msgusing the secret keyskand RFC6979 nonce Requires a signing-capable context. - sign_
grind_ r - Constructs a signature for
msgusing the secret keysk, RFC6979 nonce and “grinds” the nonce by passing extra entropy if necessary to produce a signature that is less than 71 -bytes_to_grindbytes. The number of signing operation performed by this function is exponential in the number of bytes grinded. Requires a signing capable context. - sign_
low_ r - Constructs a signature for
msgusing the secret keysk, RFC6979 nonce and “grinds” the nonce by passing extra entropy if necessary to produce a signature that is less than 71 bytes and compatible with the low r signature implementation of bitcoin core. In average, this function will perform two signing operations. Requires a signing capable context. - sign_
with_ noncedata - Constructs a signature for
msgusing the secret keyskand RFC6979 nonce and includes 32 bytes of noncedata in the nonce generation via inclusion in one of the hash operations during nonce generation. This is useful when multiple signatures are needed for the same Message and SecretKey while still using RFC6979. Requires a signing-capable context. - verify
- Checks that
sigis a valid ECDSA signature formsgusing the public keypubkey. ReturnsOk(())on success. Note that this function cannot be used for Bitcoin consensus checking since there may exist signatures which OpenSSL would verify but not libsecp256k1, or vice-versa. Requires a verify-capable context.