hasLowS method

bool hasLowS()

Comparable to bitcoind's IsLowDERSignature. Returns true if the signature has a 'low' S-value.

See also ECDSA signature algorithm which enforces See also BIP 62, 'low S values in signatures'

Implementation

bool hasLowS() {
    var hex = '7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0';

    if (_s! < (BigInt.from(1)) || _s! > (BigInt.parse(hex, radix: 16))) {
        return false;
    }

    return true;
}