A Native Ecdsa Module
Usage
Check out the tests
Test
Tests use mocha
npm test
API
new Ecdsa()
Creates an new Ecdsa Key object
sign(hash, priv)
Signs a hash
Parameters
hash: Buffer, a Buffer
of the length 32 that will be signed
priv: Buffer, a private key that is a Buffer
of the length 32
Returns: Object, - a object with a r
and s
propety both of which are Buffer
signCompressed(hash, priv)
Parameters
hash: Buffer, a Buffer
of the length 32 that will be signed
priv: Buffer, the private key, A Buffer
with the length of 32
verifyCompressed(hash, sig)
Parameters
hash: Buffer, the hash to verify
sig: Object, the signature as an Object
that has a r
, s
and i
property
Returns: Boolean,
parseDERsig(sig)
Parameters
sig: Buffer,
Returns: Object,
rs2DER(r, s)
Parameters
r: Buffer,
s: Buffer,
Returns: Buffer,
recoverPubKey(e, r, s, i)
Parameters
e: Buffer,
r: Buffer,
s: Buffer,
i: Number,
Returns: Object,
calcPubKeyRecoveryParam(e , r, s, q)
Calculate pubkey extraction parameter. Parameters
e: Buffer,
r: Buffer,
s: Buffer,
q: Buffer ,
Returns: Object
History
I attemped to track down the all contrubitures and list them but I gave up. So instead I list the history if the cpp code.
- This module was separated out of bitcore
- Which in turn was reused from bitcoinjs-servrer
- Who borrowed the code from bitcoind