Exemplo n.º 1
0
 }).then(function (result) {
   var signature = bitcoin.ECSignature.fromDER(
     new Buffer('30' + result.bytes(1).toString(HEX), 'hex')
   );
   var i;
   if (dev.features.signMessageRecoveryParam) {
     i = result.byteAt(0) & 0x01;
   } else {
     i = bitcoin.ecdsa.calcPubKeyRecoveryParam(
       BigInteger.fromBuffer(bitcoin.message.magicHash(msg_plain)),
       { r: signature.r, s: signature.s },
       pk.keyPair.Q
     );
   }
   return {
     r: signature.r,
     s: signature.s,
     i: i
   };
 });
Exemplo n.º 2
0
 return pubkeys.some(pubkey => {
   const Q = ECPubKey.fromBuffer(pubkey).Q;
   return ecdsa.verify(curve, hash, signature, Q);
 });
Exemplo n.º 3
0
Key.prototype.sign = function (buf) {
	return Bitcoin.ecdsa.sign(Bitcoin.ECKey.curve, buf, this.d);
};