View Source Bitcoinex.Secp256k1.Ecdsa (bitcoinex v0.1.8)
Link to this section Summary
Functions
deterministic_k implements rfc6979 and returns a deterministic k value for signatures
ecdsa_recover_compact does ECDSA public key recovery.
sign returns an ECDSA signature using the privkey and z where privkey is a PrivateKey object and z is an integer. The nonce is derived using RFC6979.
sign_message returns an ECDSA signature using the privkey and "Bitcoin Signed Message: <msg>" where privkey is a PrivateKey object and msg is a binary message to be hashed. The message is hashed using hash256 (double SHA256) and the nonce is derived using RFC6979.
verify whether the ecdsa signature is valid for the given message hash and public key
Link to this section Functions
@spec deterministic_k(Bitcoinex.Secp256k1.PrivateKey.t(), non_neg_integer()) :: Bitcoinex.Secp256k1.PrivateKey.t()
deterministic_k implements rfc6979 and returns a deterministic k value for signatures
@spec ecdsa_recover_compact(binary(), binary(), integer()) :: {:ok, binary()} | {:error, String.t()}
ecdsa_recover_compact does ECDSA public key recovery.
@spec sign(Bitcoinex.Secp256k1.PrivateKey.t(), integer()) :: Bitcoinex.Secp256k1.Signature.t()
sign returns an ECDSA signature using the privkey and z where privkey is a PrivateKey object and z is an integer. The nonce is derived using RFC6979.
@spec sign_message(Bitcoinex.Secp256k1.PrivateKey.t(), binary()) :: Bitcoinex.Secp256k1.Signature.t()
sign_message returns an ECDSA signature using the privkey and "Bitcoin Signed Message: <msg>" where privkey is a PrivateKey object and msg is a binary message to be hashed. The message is hashed using hash256 (double SHA256) and the nonce is derived using RFC6979.
@spec verify_signature( Bitcoinex.Secp256k1.Point.t(), integer(), Bitcoinex.Secp256k1.Signature.t() ) :: boolean()
verify whether the ecdsa signature is valid for the given message hash and public key