summaryrefslogtreecommitdiffstats
path: root/Modules/sha3module.c
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] gh-134696: align OpenSSL and HACL*-based hash functions constructors ↵Bénédikt Tran2025-06-011-8/+13
| | | | | | | | | | AC signatures (GH-134713) (#134962) OpenSSL and HACL*-based hash functions constructors now support both `data` and `string` parameters. Previously these constructor functions inconsistently supported sometimes `data` and sometimes `string`, while the documentation expected `data` to be given in all cases. (cherry picked from commit c6e63d9d351f6d952000ec3bf84b3a7607989f92) (cherry picked from commit 379d0bc95646dfe923e7ea05fb7f1befbd85572d)
* gh-116322: Add Py_mod_gil module slot (#116882)Brett Simmers2024-05-031-0/+1
| | | | | | | | | | | | | | This PR adds the ability to enable the GIL if it was disabled at interpreter startup, and modifies the multi-phase module initialization path to enable the GIL when loading a module, unless that module's spec includes a slot indicating it can run safely without the GIL. PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148. A warning will be issued up to once per interpreter for the first GIL-using module that is loaded. If `-v` is given, a shorter message will be printed to stderr every time a GIL-using module is loaded (including the first one that issues a warning).
* gh-99108: Refresh HACL*; update modules accordingly; fix namespacing (GH-117237)Jonathan Protzenko2024-03-261-22/+22
| | | Pulls in a new update from https://github.com/hacl-star/hacl-star and fixes our C "namespacing" done by `Modules/_hacl/refresh.sh`.
* gh-111916: Make hashlib related modules thread-safe without the GIL (#111981)Tomas R2023-11-151-11/+12
| | | | | Always use an individual lock on hash objects when in free-threaded builds. Fixes #111916
* gh-99108: Release the GIL around hashlib built-in computation (#104675)Gregory P. Smith2023-05-231-2/+34
| | | | | | | This matches the GIL releasing behavior of our existing `_hashopenssl` module, extending it to the HACL* built-ins. Includes adding comments to better describe the ENTER/LEAVE macros purpose and explain the lock strategy in both existing and new code.
* gh-99108: Replace SHA3 implementation HACL* version (#103597)Jonathan Protzenko2023-05-081-0/+591
Replaces our built-in SHA3 implementation with a verified one from the HACL* project. This implementation is used when OpenSSL does not provide SHA3 or is not present. 3.11 shiped with a very slow tiny sha3 implementation to get off of the <=3.10 reference implementation that wound up having serious bugs. This brings us back to a reasonably performing built-in implementation consistent with what we've just replaced our other guaranteed available standard hash algorithms with: code from the HACL* project. --------- Co-authored-by: Gregory P. Smith <greg@krypto.org>