You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int ret = secp256k1_ecdsa_sign_recoverable(secp256k1_context_sign, &rsig, hash.begin(), UCharCast(begin()), secp256k1_nonce_function_rfc6979, nullptr);
271
+
272
+
// Grind for low R
273
+
while (ret && !SigHasLowR(&rsig) && grind) {
274
+
WriteLE32(extra_entropy, ++counter);
275
+
ret = secp256k1_ecdsa_sign_recoverable(secp256k1_context_sign, &rsig, hash.begin(), UCharCast(begin()), secp256k1_nonce_function_rfc6979, extra_entropy);
276
+
}
256
277
assert(ret);
257
278
ret = secp256k1_ecdsa_recoverable_signature_serialize_compact(secp256k1_context_sign, &vchSig[1], &rec, &rsig);
258
279
assert(ret);
259
280
assert(rec != -1);
260
-
vchSig[0] = 27 + rec + (fCompressed ? 4 : 0);
281
+
vchSig[0] = header + rec + (fCompressed ? 4 : 0);
261
282
// Additional verification step to prevent using a potentially corrupted signature
262
283
secp256k1_pubkey epk, rpk;
263
284
ret = secp256k1_ec_pubkey_create(secp256k1_context_sign, &epk, UCharCast(begin()));
0 commit comments