[Python-checkins] (no subject)

Batuhan Taşkaya webhook-mailer at python.org
Sat Apr 4 17:25:20 EDT 2020




To: python-checkins at python.org
Subject: closes bpo-40184: Only define pysiphash if the hash algorithm is
 SIPHASH24. (GH-19369)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

https://github.com/python/cpython/commit/1b21573a89632356737a24302dd64c9eb145=
7a7b
commit: 1b21573a89632356737a24302dd64c9eb1457a7b
branch: master
author: Batuhan Ta=C5=9Fkaya <batuhanosmantaskaya at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-04-04T16:25:12-05:00
summary:

closes bpo-40184: Only define pysiphash if the hash algorithm is SIPHASH24. (=
GH-19369)

files:
M Python/pyhash.c

diff --git a/Python/pyhash.c b/Python/pyhash.c
index faac730d79dee..a6f42e71cf643 100644
--- a/Python/pyhash.c
+++ b/Python/pyhash.c
@@ -412,13 +412,6 @@ siphash24(uint64_t k0, uint64_t k1, const void *src, Py_=
ssize_t src_sz) {
     return t;
 }
=20
-static Py_hash_t
-pysiphash(const void *src, Py_ssize_t src_sz) {
-    return (Py_hash_t)siphash24(
-        _le64toh(_Py_HashSecret.siphash.k0), _le64toh(_Py_HashSecret.siphash=
.k1),
-        src, src_sz);
-}
-
 uint64_t
 _Py_KeyedHash(uint64_t key, const void *src, Py_ssize_t src_sz)
 {
@@ -427,6 +420,13 @@ _Py_KeyedHash(uint64_t key, const void *src, Py_ssize_t =
src_sz)
=20
=20
 #if Py_HASH_ALGORITHM =3D=3D Py_HASH_SIPHASH24
+static Py_hash_t
+pysiphash(const void *src, Py_ssize_t src_sz) {
+    return (Py_hash_t)siphash24(
+        _le64toh(_Py_HashSecret.siphash.k0), _le64toh(_Py_HashSecret.siphash=
.k1),
+        src, src_sz);
+}
+
 static PyHash_FuncDef PyHash_Func =3D {pysiphash, "siphash24", 64, 128};
 #endif
=20



More information about the Python-checkins mailing list