← 返回首页
Added documentation describing the dklen is expected in bytes for the… by thiezn · Pull Request #106624 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Added documentation describing the dklen is expected in bytes for the…#106624

Merged
serhiy-storchaka merged 4 commits into
python:mainfrom
thiezn:main
May 22, 2024
Merged

Added documentation describing the dklen is expected in bytes for the…#106624
serhiy-storchaka merged 4 commits into
python:mainfrom
thiezn:main

Conversation

thiezn commented Jul 11, 2023
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Contributor

Update hashlib.pbkdf2_hmac docs that dklen is in bytes

The hashlib.pbkfdf2_hmac documentation states that you can pass on the length of the derived key. It is however ambiguous if it's meant to be passed on as bytes or bits.

The CPython implementation relies on the OpenSSL C library. Looking at the OpenSSL source code, the function is expected to be in bytes.

Although this might be obvious to most people, some other language libraries handle this in bits.

Ps. This is my first pull request to cPython. I hope I'm not missing anything?

📚 Documentation preview 📚: https://cpython-previews--106624.org.readthedocs.build/

thiezn requested a review from tiran as a code owner July 11, 2023 13:08
bedevere-bot added awaiting review docs Documentation in the Doc dir skip news labels Jul 11, 2023

ghost commented Jul 11, 2023
edited by ghost
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

There is a similar case in the documentation for scrypt() few lines below. Please add "in bytes" there too.

thiezn requested a review from gpshead as a code owner May 22, 2024 07:12

thiezn commented May 22, 2024

Copy link
Copy Markdown
Contributor Author

Updated dklen documentation for scrypt() to include 'in bytes'

thiezn requested a review from serhiy-storchaka May 22, 2024 07:42

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

LGTM.

serhiy-storchaka merged commit 5adf78f into python:main May 22, 2024

Copy link
Copy Markdown

Thanks @thiezn for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 22, 2024
…thonGH-106624) (cherry picked from commit 5adf78f) Co-authored-by: Mathijs Mortimer <thiezn@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 22, 2024
…thonGH-106624) (cherry picked from commit 5adf78f) Co-authored-by: Mathijs Mortimer <thiezn@users.noreply.github.com>

bedevere-app Bot commented May 22, 2024

Copy link
Copy Markdown

GH-119383 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label May 22, 2024

bedevere-app Bot commented May 22, 2024

Copy link
Copy Markdown

GH-119384 is a backport of this pull request to the 3.12 branch.

bedevere-app Bot removed the needs backport to 3.12 only security fixes label May 22, 2024
serhiy-storchaka pushed a commit that referenced this pull request May 22, 2024
…ons (GH-106624) (GH-119384) (cherry picked from commit 5adf78f) Co-authored-by: Mathijs Mortimer <thiezn@users.noreply.github.com>
serhiy-storchaka pushed a commit that referenced this pull request May 22, 2024
…ons (GH-106624) (GH-119383) (cherry picked from commit 5adf78f) Co-authored-by: Mathijs Mortimer <thiezn@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Footer

© 2026 GitHub, Inc.