gpg: comment about digest size

nistp521
Roman Zeyde 8 years ago
parent fe185c190e
commit aaade1737f

@ -66,6 +66,7 @@ def open_connection(keygrip_bytes):
def pksign(keygrip, digest, algo):
"""Sign a message digest using a private EC key."""
assert algo == b'8', 'Unsupported hash algorithm ID {}'.format(algo)
assert len(digest) == 64 # SHA-256 bits (in hex digits)
keygrip_bytes = binascii.unhexlify(keygrip)
with open_connection(keygrip_bytes) as conn:
r, s = conn.sign(binascii.unhexlify(digest))

Loading…
Cancel
Save