From aa95a29c5dbbb7230253cb2d07bec89799a42da5 Mon Sep 17 00:00:00 2001 From: Mathijs Mortimer Date: Tue, 11 Jul 2023 14:54:21 +0200 Subject: [PATCH 1/2] Added documentation describing the dklen is expected in bytes for the hashlib.pbkdf2_hmac function. --- Doc/library/hashlib.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst index 8102767a43d6dd..d2e4fbb324a061 100644 --- a/Doc/library/hashlib.rst +++ b/Doc/library/hashlib.rst @@ -330,7 +330,7 @@ include a `salt `_. your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers on the `stackexchange pbkdf2 iterations question`_ explain in detail. - *dklen* is the length of the derived key. If *dklen* is ``None`` then the + *dklen* is the length of the derived key in bytes. If *dklen* is ``None`` then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512. >>> from hashlib import pbkdf2_hmac From 76f6d6bf25cf2c5dfbe6914dbf12d9781eb948fc Mon Sep 17 00:00:00 2001 From: Mathijs Mortimer Date: Wed, 22 May 2024 09:11:01 +0200 Subject: [PATCH 2/2] Updated scrypt dklen parameter description to specify it is in bytes --- Doc/library/hashlib.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst index d2e4fbb324a061..98a77d1682159c 100644 --- a/Doc/library/hashlib.rst +++ b/Doc/library/hashlib.rst @@ -359,7 +359,7 @@ include a `salt `_. *n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). - *dklen* is the length of the derived key. + *dklen* is the length of the derived key in bytes. .. versionadded:: 3.6