mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
bpo-47095: Use libb2 to provide blake2 implementation (GH-32059)
This commit is contained in:
parent
c23ddf5ec2
commit
b16b6bb8da
19 changed files with 149 additions and 17791 deletions
|
|
@ -21,14 +21,9 @@
|
|||
#include "pycore_strhex.h" // _Py_strhex()
|
||||
|
||||
#include "../hashlib.h"
|
||||
#include "blake2ns.h"
|
||||
|
||||
#define HAVE_BLAKE2B 1
|
||||
#define BLAKE2_LOCAL_INLINE(type) Py_LOCAL_INLINE(type)
|
||||
|
||||
#include "impl/blake2.h"
|
||||
#include "impl/blake2-impl.h" /* for secure_zero_memory() and store48() */
|
||||
#include "blake2module.h"
|
||||
|
||||
#ifndef HAVE_LIBB2
|
||||
/* pure SSE2 implementation is very slow, so only use the more optimized SSSE3+
|
||||
* https://bugs.python.org/issue31834 */
|
||||
#if defined(__SSSE3__) || defined(__SSE4_1__) || defined(__AVX__) || defined(__XOP__)
|
||||
|
|
@ -36,10 +31,13 @@
|
|||
#else
|
||||
#include "impl/blake2b-ref.c"
|
||||
#endif
|
||||
#endif // !HAVE_LIBB2
|
||||
|
||||
#define HAVE_BLAKE2B 1
|
||||
|
||||
extern PyType_Spec blake2b_type_spec;
|
||||
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
blake2b_param param;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue