mirror of https://github.com/nucypher/pyUmbral.git
Add a comment about normalizing s in signatures
parent
89e6ea1063
commit
f31a3ad1c2
|
@ -34,7 +34,10 @@ class Signer:
|
|||
signature_der_bytes = backend_sk.sign(message, signature_algorithm)
|
||||
r_int, s_int = utils.decode_dss_signature(signature_der_bytes)
|
||||
|
||||
# Normalize s
|
||||
# Normalize s. This is a non-malleability measure, which OpenSSL doesn't do.
|
||||
# See Bitcoin's BIP-0062 for more details:
|
||||
# https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#Low_S_values_in_signatures
|
||||
|
||||
# s is public, so no constant-timeness required here
|
||||
if s_int > (CURVE.order >> 1):
|
||||
s_int = CURVE.order - s_int
|
||||
|
|
Loading…
Reference in New Issue