]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-135004: rewrite and cleanup `blake2module.c` (#135006)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Mon, 9 Jun 2025 07:17:43 +0000 (09:17 +0200)
committerGitHub <noreply@github.com>
Mon, 9 Jun 2025 07:17:43 +0000 (09:17 +0200)
commit3cb109796dd4b07625b21773bbc04697c65bdf20
treee2c19d4a66b620b2cbb0416b079005bbf1be9e12
parent83b94e856e9b55e3ad00e272ccd5e80eafa94443
gh-135004: rewrite and cleanup `blake2module.c` (#135006)

* Cleanup imports and update module docstring.
* Simplify detection of SIMD support.
* Correctly guard `update()` cases.
* Rewrite `py_blake2b_or_s_new` and rename it to `py_blake2_new`.
* Rewrite `blake2_blake2b_copy_locked` and `py_blake2_clear`.
* Refactor computations of `digest` and `hexdigest`.
* Simplify `py_blake2b_get_name` and `py_blake2b_get_block_size`.
* Add `hacl_get_blake2_info` to extract static BLAKE-2 information.
   This new helper is used by `py_blake2b_get_digest_size`, but can
   be later used to expose `key_length` more easily.
Misc/NEWS.d/next/Library/2025-06-01-14-18-48.gh-issue-135004.cq3-fp.rst [new file with mode: 0644]
Modules/blake2module.c
Modules/hmacmodule.c