]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-99108: Refactor _sha256 & _sha512 into _sha2. (#101924)
authorGregory P. Smith <greg@krypto.org>
Thu, 16 Feb 2023 06:08:20 +0000 (22:08 -0800)
committerGitHub <noreply@github.com>
Thu, 16 Feb 2023 06:08:20 +0000 (22:08 -0800)
commit0b13575e74ff3321364a3389eda6b4e92792afe1
tree1fc6775cb290958f1c4d0e98c17300629f8aa9c4
parent89ac665891dec1988bedec2ce9b2c4d016502a49
gh-99108: Refactor _sha256 & _sha512 into _sha2. (#101924)

This merges their code. They're backed by the same single HACL* static library, having them be a single module simplifies maintenance.

This should unbreak the wasm enscripten builds that currently fail due to linking in --whole-archive mode and the HACL* library appearing twice.

Long unnoticed error fixed: _sha512.SHA384Type was doubly assigned and was actually SHA512Type. Nobody depends on those internal names.

Also rename LIBHACL_ make vars to LIBHACL_SHA2_ in preperation for other future HACL things.
18 files changed:
Lib/hashlib.py
Lib/test/test_hashlib.py
Makefile.pre.in
Misc/NEWS.d/next/Library/2023-02-15-01-54-06.gh-issue-99108.rjTSic.rst [new file with mode: 0644]
Modules/Setup
Modules/Setup.stdlib.in
Modules/clinic/sha256module.c.h [deleted file]
Modules/clinic/sha2module.c.h [new file with mode: 0644]
Modules/clinic/sha512module.c.h [deleted file]
Modules/sha256module.c [deleted file]
Modules/sha2module.c [new file with mode: 0644]
Modules/sha512module.c [deleted file]
PC/config.c
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Python/stdlib_module_names.h
configure
configure.ac