New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-29410: Change the default hash algorithm to SipHash13. #28752
Conversation
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
When you're done making the requested changes, leave the comment: |
How to add deprecation to undocumented macro? Comment in header is enough? |
They is just alias for siphash13.
You could add |
Co-authored-by: Christian Heimes <christian@python.org>
@@ -206,6 +206,19 @@ class StringlikeHashRandomizationTests(HashRandomizationTests): | |||
# seed 42, 'abc' | |||
[-678966196, 573763426263223372, -820489388, -4282905804826039665], | |||
], | |||
'siphash13': [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created by this code. https://gist.github.com/methane/5bb59a0563a025994e49fac509b49bf9
I have made the requested changes; please review again. |
Thanks for making the requested changes! @tiran: please review the changes made to this pull request. |
Doc/whatsnew/3.11.rst
Outdated
@@ -175,6 +175,9 @@ Other CPython Implementation Changes | |||
support :class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` protocols. | |||
(Contributed by Mark Dickinson and Dong-hee Na in :issue:`24234`.) | |||
|
|||
* ``siphash13`` is added as a new internal hash algorithm for strings, and the default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit pick: Your change affects str, bytes, and a couple of other places like memoryview, regular expressions, and datetime objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the word "strings" because I don't have a better word to represent it. Any suggestion?
Configure script and https://docs.python.org/3/using/configure.html#security-options uses: "hash algorithm for use in Python/pyhash.c".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention why we made it the default and that str and bytes are affected. Perhaps something like
siphash13
is added as a new internal hashing algorithms. It's has similar security properties assiphash24
but it is slightly faster for long inputs.str
,bytes
, and some other types now use it as default algorithm forhash()
When you're done making the requested changes, leave the comment: |
Co-authored-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue29410