mirror of
https://github.com/OutCast3k/coinbin.git
synced 2025-03-10 11:39:05 +01:00
Force lower s value per BIP62
This commit is contained in:
parent
b4db267cd7
commit
de1e5558dc
@ -769,6 +769,12 @@
|
||||
badrs++
|
||||
} while (r.compareTo(BigInteger.ZERO) <= 0 || s.compareTo(BigInteger.ZERO) <= 0);
|
||||
|
||||
// Force lower s values per BIP62
|
||||
var halfn = n.shiftRight(1);
|
||||
if (s.compareTo(halfn) > 0) {
|
||||
s = n.subtract(s);
|
||||
};
|
||||
|
||||
var sig = serializeSig(r, s);
|
||||
sig.push(parseInt(1, 10));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user