summaryrefslogtreecommitdiffstats
path: root/Modules/_blake2
Commit message (Collapse)AuthorAgeFilesLines
* [3.6] bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346) ↵Serhiy Storchaka2018-10-114-124/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-8581) (GH-9657) * help(hashlib) didn't work because of incorrect module name in blake2b and blake2s classes. * Constructors blake2*(), sha3_*(), shake_*() and keccak_*() incorrectly accepted keyword argument "string" for binary data, but documented as accepting the "data" keyword argument. Now this parameter is positional-only. * Keyword-only parameters in blake2b() and blake2s() were not documented as keyword-only. * Default value for some parameters of blake2b() and blake2s() was None, which is not acceptable value. * The length argument for shake_*.digest() was wrapped out to 32 bits. * The argument for shake_128.digest() and shake_128.hexdigest() was not positional-only as intended. * TypeError messages for incorrect arguments in all constructors sha3_*(), shake_*() and keccak_*() incorrectly referred to sha3_224. Also made the following enhancements: * More accurately specified input and result types for strings, bytes and bytes-like objects. * Unified positional parameter names for update() and constructors. * Improved formatting. (cherry picked from commit f1d36d8efaecd5c84cb35e35119b283f37d83c40) (cherry picked from commit 47957dab94a4efa2fee61c9a8193f78300950769)
* [3.6] Fix misleading mentions of tp_size in comments (GH-9137)Benjamin Peterson2018-09-102-2/+2
| | | | | | | Many type object initializations labeled a field "tp_size" in the comment, but the name of that field is tp_basicsize.. (cherry picked from commit 0e0bc4e221f592f305d335faf5f8046484eb9238) Co-authored-by: Peter Eisentraut <peter@eisentraut.org>
* bpo-31933: fix blake2 multi-byte params on big endian platforms (GH-4250) ↵Miss Islington (bot)2017-11-032-4/+8
| | | | | | | | | | | | | | | (#4262) All Blake2 params have to be encoded in little-endian byte order. For the two multi-byte integer params, leaf_length and node_offset, that means that assigning a native-endian integer to them appears to work on little-endian platforms, but gives the wrong result on big-endian. The current libb2 API doesn't make that very clear, and @sneves is working on new API functions in the GH issue above. In the meantime, we can work around the problem by explicitly assigning little-endian values to the parameter block. See https://github.com/BLAKE2/libb2/issues/12. (cherry picked from commit dcfb0e3c04f1b29a0d09bb0a81dcd5ee5a5fef1a)
* Remove nested comments in blake2 (GH-4173) (#4214)Miss Islington (bot)2017-11-011-2/+4
| | | | | | | | | | | | Replace occurence of nested comments in blake2 reference implementation with preprocessor directive for disabling unused code. `blake2s-load-xop.h` is conditionally pulled in only on chips with XOP support, among others the AMD Bulldozer. The malformed comments in the source file breaks the build of `hashlib`'s `_blake2` on GCC 6.3.0. Official reference code on github uses `GH-if` so this change should be uncontroversial. (cherry picked from commit 388cd85e51aa9c73f8e7f35f0d06c258be7b579c)
* more PY_LONG_LONG to long longBenjamin Peterson2016-09-082-4/+4
|
* Issue #26798: Coverity complains about potential memcpy() of overlapped ↵Christian Heimes2016-09-084-4/+4
| | | | regions. It doesn't hurt to use memmove() here. CID 1372514 / CID 1372515. Upstream https://github.com/BLAKE2/BLAKE2/issues/32
* blake2: silence two more warnings on platforms with size_t < uint64_t. Don't ↵Christian Heimes2016-09-072-4/+4
| | | | use SSE2 when cross-compiling
* Silence two warnings in blake2. key_length is between 0 and 64 (block size).Christian Heimes2016-09-072-2/+2
|
* Issue #26798: for loop initial declarations, take 3Christian Heimes2016-09-061-0/+1
|
* Issue #26798: for loop initial declarations, take 2Christian Heimes2016-09-064-17/+23
|
* Issue #26798: for loop initial declarations are only allowed in C99 or C11 modeChristian Heimes2016-09-064-9/+18
|
* Issue #26798: Add BLAKE2 (blake2b and blake2s) to hashlib.Christian Heimes2016-09-0621-0/+4639