tuweni / org.apache.tuweni.crypto / SECP256K1 / Signature / isCanonical

isCanonical

open fun isCanonical(): Boolean (source)

Check if the signature is canonical. Every signature (r,s) has an equivalent signature (r, -s (mod N)) that is also valid for the same message. The canonical signature is considered the signature with the s-value less than or equal to half the curve order.

Return
Boolean: true if this is the canonical form of the signature, and false otherwise.