◐ Shell
clean mode source ↗

gh-99108: Add HACL* Blake2 implementation to hashlib by msprotz · Pull Request #119316 · python/cpython

added 3 commits

March 25, 2024 15:11

eli-schwartz

@msprotz

…ASHLIB_HASHES appears twice as a #define in confdefs.h -- try to fix this
…erly by distinguishing simd128 from simd256

@gpshead

blhsing pushed a commit to blhsing/cpython that referenced this pull request

Aug 22, 2024
…119316)

This replaces the existing hashlib Blake2 module with a single implementation that uses HACL\*'s Blake2b/Blake2s implementations. We added support for all the modes exposed by the Python API, including tree hashing, leaf nodes, and so on. We ported and merged all of these changes upstream in HACL\*, added test vectors based on Python's existing implementation, and exposed everything needed for hashlib.

This was joint work done with @R1kM.

See the PR for much discussion and benchmarking details.   TL;DR: On many systems, 8-50% faster (!) than `libb2`, on some systems it appeared 10-20% slower than `libb2`.

This was referenced

Sep 5, 2024