gh-131876: Revert "gh-131876: extract _hashlib helpers into a separate directory (#136995) (#137307)
Some checks are pending
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / Windows MSI (push) Blocked by required conditions
Tests / (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / Ubuntu SSL tests with AWS-LC (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Sanitizers (push) Blocked by required conditions
Tests / Cross build Linux (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run
mypy / Run mypy on Lib/_pyrepl (push) Waiting to run
mypy / Run mypy on Lib/test/libregrtest (push) Waiting to run
mypy / Run mypy on Lib/tomllib (push) Waiting to run
mypy / Run mypy on Tools/build (push) Waiting to run
mypy / Run mypy on Tools/cases_generator (push) Waiting to run
mypy / Run mypy on Tools/clinic (push) Waiting to run
mypy / Run mypy on Tools/jit (push) Waiting to run
mypy / Run mypy on Tools/peg_generator (push) Waiting to run

Revert "gh-131876: extract `_hashlib` helpers into a separate directory (#136995)"

This reverts commit 45138d3584.
This commit is contained in:
Bénédikt Tran 2025-08-01 19:45:40 +02:00 committed by GitHub
parent e7b55f564d
commit fe0e921817
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 221 additions and 346 deletions

View file

@ -20,10 +20,6 @@
#include "pycore_hashtable.h"
#include "pycore_strhex.h" // _Py_strhex()
#include "_hashlib/hashlib_buffer.h"
#include "_hashlib/hashlib_fetch.h"
#include "_hashlib/hashlib_mutex.h"
/*
* Taken from blake2module.c. In the future, detection of SIMD support
* should be delegated to https://github.com/python/cpython/pull/125011.
@ -51,6 +47,8 @@
#include <stdbool.h>
#include "hashlib.h"
// --- Reusable error messages ------------------------------------------------
static inline void
@ -658,7 +656,7 @@ find_hash_info(hmacmodule_state *state, PyObject *hash_info_ref)
}
if (rc == 0) {
PyErr_Format(state->unknown_hash_error,
_Py_HASHLIB_UNSUPPORTED_ALGORITHM, hash_info_ref);
HASHLIB_UNSUPPORTED_ALGORITHM, hash_info_ref);
return NULL;
}
assert(info != NULL);