bip66
Strict DER signature encoding/decoding.
See bip66.
- This module works only with two's complement numbers.
- BIP66 doesn't check that
r
or s
are fully valid.
check
/decode
doesn't check that r
or s
great than 33 bytes or that this number represent valid point on elliptic curve.encode
doesn't check that r
/s
represent valid point on elliptic curve.
Example
var bip66 = require('bip66')
var r = new Buffer('1ea1fdff81b3a271659df4aad19bc4ef83def389131a36358fe64b245632e777', 'hex')
var s = new Buffer('29e164658be9ce810921bf81d6b86694785a79ea1e52dbfa5105148d1f0bc1', 'hex')
bip66.encode(r, s)
var signature = new Buffer('304302201ea1fdff81b3a271659df4aad19bc4ef83def389131a36358fe64b245632e777021f29e164658be9ce810921bf81d6b86694785a79ea1e52dbfa5105148d1f0bc1', 'hex')
bip66.decode(signature)
A catch-all exception regex:
/Expected DER (integer|sequence)|(R|S) value (excessively padded|is negative)|(R|S|DER sequence) length is (zero|too short|too long|invalid)/
LICENSE MIT