From 797616c1c6cf3c2d3e5792037e90091b5eb3ab4e Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 7 Sep 2017 11:34:21 -0700 Subject: [PATCH] clarify the siphash key is hardcoded --- pep-0552.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pep-0552.txt b/pep-0552.txt index 0cb152921..f6035ca96 100644 --- a/pep-0552.txt +++ b/pep-0552.txt @@ -60,12 +60,12 @@ version. One magic number will correspond to the current pyc format and the other to "hash-based" pycs introduced by this PEP. In hash-based pycs, the second field in the pyc header (currently the -"timestamp" field) will contain the SipHash_ of the contents of the source -file. Another a fast hash like MD5 or BLAKE2_ would also work. We choose SipHash -because Python already has a builtin implementation of it from :pep:`456`. The -third field in the pyc header (currently the "source size" field) will become a -bitset of flags. We define the lowest flag in this bitset called -``check_source`` +"timestamp" field) will contain the SipHash_ (with a hardcoded key) of the +contents of the source file. Another a fast hash like MD5 or BLAKE2_ would also +work. We choose SipHash because Python already has a builtin implementation of +it from :pep:`456`. The third field in the pyc header (currently the "source +size" field) will become a bitset of flags. We define the lowest flag in this +bitset called ``check_source`` When Python encounters a hash-based pyc, its behavior depends on the setting of the ``check_source`` flag. If the ``check_source`` flag is set, Python will