Open xiawu opened 6 years ago
I change the following code in the point.js :
//var ec = require('elliptic').curves.secp256k1; var ec = require('elliptic').curves.p256;
After it, I try the following code, sign and verify don't work
var ecdsa = new ECDSA(); ecdsa.hashbuf = Hash.sha256(new Buffer('test data')); ecdsa.privkey = new Privkey(BN.fromBuffer( new Buffer('fee0a1f7afebf9d2a5a80c0c98a31c709681cce195cbcd06342b517970c0be1e', 'hex') )); ecdsa.privkey2pubkey(); ecdsa.signRandomK(); console.log("ecdsa.sig: " + ecdsa.sig); var ecdsa2 = ECDSA(ecdsa); ecdsa2.signRandomK(); console.log("ecdsa2.sig: " + ecdsa.sig.toString()); ecdsa.sig = Signature.fromString('304402205593283cd1612fe9dd62e922c6eba85161c36f32c3ea865f68c954cc57e80792022039f579b5bc8b1a936ceec66b46ff8c3c6635056fca82b58ab0769b52c8d2153a'); var status = ecdsa.verify().verified; console.log("status:" + status);
thanks for any suggestions.
@petertodd
I change the following code in the point.js :
After it, I try the following code, sign and verify don't work
thanks for any suggestions.
@petertodd