Skip to content
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

Commit 069f639

Browse files
mfischersybrenstuvel
authored andcommitted
rsa/pkcs1.py: Clarify functionality of sign_hash()
Clarify functionality that a hash is not computed, rather a precomputed (given) hash is being signed. Signed-off-by: Moritz Fischer <moritzf@google.com>
1 parent b94766f commit 069f639

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rsa/pkcs1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ def decrypt(crypto: bytes, priv_key: key.PrivateKey) -> bytes:
287287
def sign_hash(hash_value: bytes, priv_key: key.PrivateKey, hash_method: str) -> bytes:
288288
"""Signs a precomputed hash with the private key.
289289
290-
Hashes the message, then signs the hash with the given key. This is known
291-
as a "detached signature", because the message itself isn't altered.
290+
Signs the hash with the given key. This is known as a "detached signature",
291+
because the message itself isn't altered.
292292
293293
:param hash_value: A precomputed hash to sign (ignores message).
294294
:param priv_key: the :py:class:`rsa.PrivateKey` to sign with

0 commit comments

Comments
 (0)