bpo-36559: random module: optimize sha512 import#12742
Merged
rhettinger merged 1 commit intopython:masterfrom Apr 10, 2019
Merged
bpo-36559: random module: optimize sha512 import#12742rhettinger merged 1 commit intopython:masterfrom
rhettinger merged 1 commit intopython:masterfrom
Conversation
Member
|
Does it work without OpenSSL? |
Member
|
Travis CI failed: |
Member
Yes, the _sha512 module is unrelated to OpenSSL. Moreover, _sha512 is available if even _hashlib (_hashopenssl.c) is missing. The _sha512 module is available even if OpenSSL is available. |
The random module now prefers the lean internal _sha512 module over hashlib for seed(version=2) to optimize import time. Signed-off-by: Christian Heimes <christian@python.org>
161956d to
8f45246
Compare
Member
Author
|
The _sha512 module contains a full implementation of sha512 and sha384 based on code from libtomcrypt. Python always builds these modules. Some vendors may not deliver the modules, because the code is not FIPS approved crypto. That's why I have included a fallback to hashlib. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The random module now prefers the lean internal _sha512 module over hashlib
for seed(version=2) to optimize import time.
Signed-off-by: Christian Heimes christian@python.org
https://bugs.python.org/issue36559