[Python-checkins] peps: More compact notation
christian.heimes
python-checkins at python.org
Thu Nov 14 00:20:21 CET 2013
http://hg.python.org/peps/rev/b6778ead0ebb
changeset: 5268:b6778ead0ebb
user: Christian Heimes <christian at cheimes.de>
date: Wed Nov 13 23:39:54 2013 +0100
summary:
More compact notation
files:
pep-0456.txt | 46 ++++++++++++---------------------------
1 files changed, 14 insertions(+), 32 deletions(-)
diff --git a/pep-0456.txt b/pep-0456.txt
--- a/pep-0456.txt
+++ b/pep-0456.txt
@@ -180,9 +180,7 @@
defines the prototype of the function. (Note: ``k`` is split up into two
uint64_t)::
- uint64_t siphash24(const void *src,
- unsigned long src_sz,
- const char k[16]);
+ uint64_t siphash24(const void *src, unsigned long src_sz, const char k[16])
SipHash requires a 64-bit data type and is not compatible with pure C89
platforms.
@@ -199,20 +197,11 @@
Murmur3's function prototypes are::
- void MurmurHash3_x86_32(const void *key,
- int len,
- uint32_t seed,
- void *out);
+ void MurmurHash3_x86_32(const void *key, int len, uint32_t seed, void *out)
- void MurmurHash3_x86_128(const void * key,
- int len,
- uint32_t seed,
- void *out);
+ void MurmurHash3_x86_128(const void *key, int len, uint32_t seed, void *out)
- void MurmurHash3_x64_128(const void *key,
- int len,
- uint32_t seed,
- void *out);
+ void MurmurHash3_x64_128(const void *key, int len, uint32_t seed, void *out)
The 128-bit variants requires a 64-bit data type and are not compatible with
pure C89 platforms. The 32-bit variant is fully C89-compatible.
@@ -234,10 +223,8 @@
The relevant function prototype for 64-bit CityHash with 128-bit seed is::
- uint64 CityHash64WithSeeds(const char *buf,
- size_t len,
- uint64 seed0,
- uint64 seed1)
+ uint64 CityHash64WithSeeds(const char *buf, size_t len, uint64 seed0,
+ uint64 seed1)
CityHash also offers SSE 4.2 optimizations with CRC32 intrinsic for long
inputs. All variants except CityHash32 require 64-bit data types. CityHash32
@@ -253,19 +240,14 @@
TODO
-HMAC, MD5, SHA-1, SHA-2
------------------------
+Other
+-----
-These hash algorithms are too slow and have high setup and finalization costs.
-For these reasons they are not considered fit for this purpose.
-
-
-AES CMAC
---------
-
-Modern AMD and Intel CPUs have AES-NI (AES instruction set) [aes-ni]_ to speed
-up AES encryption. CMAC with AES-NI might be a viable option but it's probably
-too slow for daily operation. (testing required)
+Crypto algorithms such as HMAC, MD5, SHA-1 or SHA-2 are too slow and have
+high setup and finalization costs. For these reasons they are not considered
+fit for this purpose. Modern AMD and Intel CPUs have AES-NI (AES instruction
+set) [aes-ni]_ to speed up AES encryption. CMAC with AES-NI might be a viable
+option but it's probably too slow for daily operation. (testing required)
Conclusion
@@ -473,7 +455,7 @@
The function is moved to Python/pyhash.c and modified to use the hash function
through PyHash_Func.hash(). The function signature is altered to take
a ``const void *`` as first argument. ``_Py_HashBytes`` also takes care of
-special cases. It maps zero length input to ``0`` and return value of ``-1``
+special cases: it maps zero length input to ``0`` and return value of ``-1``
to ``-2``.
bytes_hash() (Objects/bytesobject.c)
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list