Skip to content

Implement remaining SHA2 digests - #3485

Open
geedo0 wants to merge 4 commits into
feat/provider-sha224from
feat/sha2-all
Open

geedo0 wants to merge 4 commits into
feat/provider-sha224from
feat/sha2-all

Conversation

@geedo0

@geedo0 geedo0 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Related issues

Stacked on #3449, which introduces the SHA-2 pattern this change applies. Review that one first.

Context and motivation

#3449 established what belongs to an operation class, what belongs to a family, and what an individual
algorithm owns, with SHA2-224 as its first application. This is the rest of the selected SHA-2 family.

After this the provider advertises SHA2-224, SHA2-256, SHA2-384, SHA2-512, SHA2-512/224, and
SHA2-512/256.

Description of changes

Backend (backend/operations/digests/sha2.c). Four sets of bindings written out per algorithm
rather than generated, so each AWS-LC type, constant, and function stays visible to review.

Frontend (frontend/operations/digests/sha2.c). Per algorithm: one slot declaration macro, thin
typed slot bodies naming their own backend entry points, and one dispatch-table macro. The family
helpers introduced in #3449 took no new parameters and no new abstraction.

Registry. Four rows, each citing the names.h macro it copies, carrying the OpenSSL spellings,
aliases, and OID. provider/ALGORITHM_SUPPORT.md records the family.

SHA2-256/192 is deliberately absent: AWS-LC exposes no public API for it, so that name stays the
default provider's to serve.

Testing

Both suites are parameterized, so each variant is one data row.

Review considerations

  • Are we striking the right balance between modularity, maintainability, and readability?
  • The truncated variants report block size 128, which is SHA-512's, matching what OpenSSL's own
    implementations report for these names.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache
2.0 license and the ISC license.

@geedo0
geedo0 requested a review from a team as a code owner September 4, 2026 12:28
@geedo0 geedo0 changed the title feat/sha2 all Add the remaining SHA-2 variants to the aws-lc-provider Sep 4, 2026
@geedo0 geedo0 changed the title Add the remaining SHA-2 variants to the aws-lc-provider Implement remaining SHA2 digests Sep 4, 2026
Register remaining SHA2 digests  with OpenSSL's aliases and back it with AWS-LC's public SHA2 streaming API. Extend the parameterized frontend and backend suites so geometry, context copying, known-answer output, attribution, and short-output rejection cover the new variant.
The back side is reachable by a consumer that calls a dispatch slot
directly rather than through EVP, so it cannot rely on the front side
having already screened its arguments. Guard every entry point instead
of dereferencing whatever arrives.

The out_size rationale moves to the file header rather than repeating
per algorithm, and the registry rows all name the names.h macro they
copy so a future row has a checkable source.
The digests.h declaration macro gives every algorithm an int-returning
copy, but SHA-384, SHA-512, SHA-512/224 and SHA-512/256 were still
defined as void, so the branch did not compile. Match the declaration
and report a rejected NULL the way the other two already do.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.14%. Comparing base (56e71a6) to head (62c3260).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           feat/provider-sha224    #3485      +/-   ##
========================================================
- Coverage                 78.15%   78.14%   -0.01%     
========================================================
  Files                       700      700              
  Lines                    125595   125595              
  Branches                  17371    17373       +2     
========================================================
- Hits                      98154    98146       -8     
- Misses                    26570    26578       +8     
  Partials                    871      871              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🔒 Security ReviewView Report

Please review before merging.

@justsmth
justsmth self-requested a review September 8, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants