bpo-29410: Change the default hash algorithm to SipHash13. (GH-28752)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
Inada Naoki 2021-10-10 17:29:46 +09:00 committed by GitHub
parent a1c3c9e824
commit ad970e8623
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 123 additions and 26 deletions

View file

@ -3036,16 +3036,19 @@ fi
# str, bytes and memoryview hash algorithm
AH_TEMPLATE(Py_HASH_ALGORITHM,
[Define hash algorithm for str, bytes and memoryview.
SipHash24: 1, FNV: 2, externally defined: 0])
SipHash24: 1, FNV: 2, SipHash13: 3, externally defined: 0])
AC_MSG_CHECKING(for --with-hash-algorithm)
dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
AC_ARG_WITH(hash_algorithm,
AS_HELP_STRING([--with-hash-algorithm=@<:@fnv|siphash24@:>@],
[select hash algorithm for use in Python/pyhash.c (default is SipHash24)]),
AS_HELP_STRING([--with-hash-algorithm=@<:@fnv|siphash13|siphash24@:>@],
[select hash algorithm for use in Python/pyhash.c (default is SipHash13)]),
[
AC_MSG_RESULT($withval)
case "$withval" in
siphash13)
AC_DEFINE(Py_HASH_ALGORITHM, 3)
;;
siphash24)
AC_DEFINE(Py_HASH_ALGORITHM, 1)
;;