View Source Secp256k1.ECDSA (secp256k1 v0.4.1)
Module implementing ECDSA pubkey derivation and signatures
Summary
Functions
Convert uncompressed pubkey to compressed one
Derive compressed pubkey from seckey
Convert compressed pubkey to uncompressed one
Derive pubkey from seckey
Generate ECDSA signature of message hash (AUX is randomly generated)
Generate ECDSA signature of message hash and specify AUX value - NOT RECOMMENDED
Derive uncompressed pubkey from seckey
Check if ECDSA signature is valid
Functions
@spec compress_pubkey(pubkey :: Secp256k1.uncompressed_pubkey()) :: Secp256k1.compressed_pubkey()
Convert uncompressed pubkey to compressed one
@spec compressed_pubkey(seckey :: Secp256k1.seckey()) :: Secp256k1.compressed_pubkey()
Derive compressed pubkey from seckey
@spec decompress_pubkey(pubkey :: Secp256k1.compressed_pubkey()) :: Secp256k1.uncompressed_pubkey()
Convert compressed pubkey to uncompressed one
@spec pubkey(seckey :: Secp256k1.seckey(), opts :: Keyword.t()) :: Secp256k1.compressed_pubkey() | Secp256k1.uncompressed_pubkey()
Derive pubkey from seckey
Options
- :compress (default true) - whether to format pubkey in compressed or uncompressed format
@spec sign(msg_hash :: Secp256k1.hash(), seckey :: Secp256k1.seckey()) :: Secp256k1.ecdsa_sig()
Generate ECDSA signature of message hash (AUX is randomly generated)
@spec sign( msg_hash :: Secp256k1.hash(), seckey :: Secp256k1.seckey(), aux :: <<_::256>> ) :: Secp256k1.ecdsa_sig()
Generate ECDSA signature of message hash and specify AUX value - NOT RECOMMENDED
@spec uncompressed_pubkey(seckey :: Secp256k1.seckey()) :: Secp256k1.uncompressed_pubkey()
Derive uncompressed pubkey from seckey
@spec valid?( signature :: Secp256k1.ecdsa_sig(), msg_hash :: Secp256k1.hash(), pubkey :: Secp256k1.compressed_pubkey() ) :: boolean()
Check if ECDSA signature is valid