module Secp256k1::Signature

Overview

implements ecdsa signature generation and verification for secp256k1 ref: https://cryptobook.nakov.com/digital-signatures/ecdsa-sign-verify-messages

Defined in:

signature.cr

Class Method Summary

Class Method Detail

def self.sign(msg : String, priv : BigInt) #

the ecdsa signing algorithm (rfc 6979) takes as input a message msg and a private key priv. It produces as output a signature, which consists of pair of integers (r, s).


[View source]
def self.verify(msg : String, sig : ECDSA_Signature, pub : EC_Point) #

the algorithm to verify an ecdsa signature takes as input the signed message msg and the signature (r, s) produced from self.sign and the public key pub, corresponding to the signer's private key. The result is boolean.


[View source]
def self.verify_hash(hash : BigInt, sig : ECDSA_Signature, pub : EC_Point) #

same as self.verify, just using the hashed message directly


[View source]