Add AWS-LC support for XOFHash#15129
Merged
Merged
Conversation
AWS-LC provides EVP_DigestSqueeze, so XOFHash no longer needs to be gated to OpenSSL 3.3+ only. rust-openssl already exposes Hasher::squeeze_xof on AWS-LC. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCjKRh9sZ4qXDfoVm5YAJ3
Squeeze is supported iff OpenSSL >= 3.3.0 or AWS-LC. The version cfgs are only ever set for real OpenSSL, so the LibreSSL/BoringSSL guards were redundant. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCjKRh9sZ4qXDfoVm5YAJ3
alex
reviewed
Jul 1, 2026
| skip_message="Requires backend with XOF support", | ||
| ) | ||
| def test_hash_xof(self): | ||
| def test_hash_xof(self, backend): |
Member
There was a problem hiding this comment.
I don't htink the backend arg is required, is it?
The backend fixture is autouse, so the supported marker is checked without it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SCjKRh9sZ4qXDfoVm5YAJ3
alex
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends XOFHash (Extendable Output Function) support to AWS-LC, in addition to the existing OpenSSL 3.3.0+ support.
Summary
Previously, XOFHash was only supported on OpenSSL 3.3.0 or greater. This change adds support for AWS-LC while maintaining backward compatibility with existing backends.
Key Changes
Rust backend (
src/rust/src/backend/hashes.rs):CRYPTOGRAPHY_OPENSSL_330_OR_GREATERORCRYPTOGRAPHY_IS_AWSLCis truePython tests (
tests/hazmat/primitives/test_xofhash.py):_xof_supported()helper functiontest_unsupported_boring_libretotest_unsupported_xofto reflect the more general nature of the testHash tests (
tests/hazmat/primitives/test_hashes.py):test_hash_xofto use the backend'shash_supported()method instead of directly checking OpenSSL versionrust_opensslmodule in this test fileChangelog: Added entry documenting XOFHash support for AWS-LC
Implementation Details
The changes consolidate the XOF support logic by using a positive check (backends that support XOF) rather than a negative check (backends that don't support it). This makes the code more maintainable and easier to extend to additional backends in the future.
https://claude.ai/code/session_01SCjKRh9sZ4qXDfoVm5YAJ3