Jul-02-2019, 09:27 PM
Hello all,
According to cryptography.io documentation the signature for
cryptography.hazmat.primitives.asymmetric.ec.ECDSA
is a bytes object, whose contents is DER encoded
and can be decoded using decode_dss_signature()
and decode_dss_signature is returning decoded tuple (r,s)
Found something like
According to cryptography.io documentation the signature for
cryptography.hazmat.primitives.asymmetric.ec.ECDSA
is a bytes object, whose contents is DER encoded
and can be decoded using decode_dss_signature()
and decode_dss_signature is returning decoded tuple (r,s)
r, s = decode_dss_signature(signature)How to properly concatenate (r,s) to binary again.
Found something like
r_bytes = r.to_bytes((r.bit_length() + 7) // 8, 'big') s_bytes = s.to_bytes((s.bit_length() + 7) // 8, 'big')Is this correct? and if so what's next?