Module secp256k1

Module secp256k1 

Source
Expand description

This module contains an implementation of the ECDSA signature scheme over the secp256k1 curve.

Messages can be signed and the signature can be verified again:

§Example

use rand::thread_rng;
let kp = Secp256k1KeyPair::generate(&mut thread_rng());
let message: &[u8] = b"Hello, world!";
let signature = kp.sign(message);
assert!(kp.public().verify(message, &signature).is_ok());

Modules§

recoverable
This module contains an implementation of the ECDSA signature scheme over the secp256k1 curve.

Structs§

Secp256k1KeyPair
Secp256k1 public/private key pair.
Secp256k1PrivateKey
Secp256k1 private key.
Secp256k1PublicKey
Secp256k1 public key.
Secp256k1Signature
Secp256k1 ECDSA signature.

Constants§

SECP256K1_KEYPAIR_LENGTH
The key pair bytes length is the same as the private key length. This enforces deserialization to always derive the public key from the private key.
SECP256K1_PRIVATE_KEY_LENGTH
The length of a private key in bytes.
SECP256K1_PUBLIC_KEY_LENGTH
The length of a public key in bytes.
SECP256K1_SIGNATURE_LENGTH
The length of a signature in bytes.

Statics§

SECP256K1

Type Aliases§

DefaultHash
Default hash function used for signing and verifying messages unless another hash function is specified using the with_hash functions.
Secp256k1PublicKeyAsBytes
Secp256k1SignatureAsBytes