We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var der, e, ecsignature, i, lenR, lenS, nonce; i = null; nonce = 0; e = BigInteger.fromBuffer(dataSha256); while (true) { ecsignature = ecdsa.sign(curve, dataSha256, privateKey.d, nonce++); der = ecsignature.toDER(); lenR = der[3]; lenS = der[5 + lenR]; if (lenR === 32 && lenS === 32) { i = ecdsa.calcPubKeyRecoveryParam(curve, e, ecsignature, privateKey.toPublic().Q); i += 4; // compressed i += 27; // compact // 24 or 27 :( forcing odd-y 2nd key candidate) break; } if (nonce % 10 === 0) { console.log("WARN: " + nonce + " attempts to find canonical signature"); } }
eosjc-ecc 里面需要r和s都是32字节
The text was updated successfully, but these errors were encountered:
No branches or pull requests
var der, e, ecsignature, i, lenR, lenS, nonce;
i = null;
nonce = 0;
e = BigInteger.fromBuffer(dataSha256);
while (true) {
ecsignature = ecdsa.sign(curve, dataSha256, privateKey.d, nonce++);
der = ecsignature.toDER();
lenR = der[3];
lenS = der[5 + lenR];
if (lenR === 32 && lenS === 32) {
i = ecdsa.calcPubKeyRecoveryParam(curve, e, ecsignature, privateKey.toPublic().Q);
i += 4; // compressed
i += 27; // compact // 24 or 27 :( forcing odd-y 2nd key candidate)
break;
}
if (nonce % 10 === 0) {
console.log("WARN: " + nonce + " attempts to find canonical signature");
}
}
eosjc-ecc 里面需要r和s都是32字节
The text was updated successfully, but these errors were encountered: