Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHA3 #84132

Merged
merged 52 commits into from
Jun 1, 2023
Merged

SHA3 #84132

merged 52 commits into from
Jun 1, 2023

Conversation

vcsjones
Copy link
Member

@vcsjones vcsjones commented Mar 30, 2023

This implements the following SHA3 APIs:

  • SHA3_256, SHA3_384, SHA3_512
  • HMACSHA3_256, HMACSHA3_384, HMACSHA3_512
  • HashAlgorithmName.SHA3_256, HashAlgorithmName.SHA3_384, HashAlgorithmName.SHA3_512
  • RSAEncryptionPadding.OaepSHA3_256, RSAEncryptionPadding.OaepSHA3_384, RSAEncryptionPadding.OaepSHA3_512

In addition, this lights up the use of SHA-3 in several places that accept a HashAlgorithmName, such as Rfc2898DeriveBytes, HKDF, and SP800108HmacCounterKdf

SHAKE is not in this pull request. It will be a follow up.

Contributes to #20342

@vcsjones vcsjones added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it labels Mar 30, 2023
@ghost ghost assigned vcsjones Mar 30, 2023
@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Mar 30, 2023

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

Issue Details

Not ready for review or API approved. Giving this a run through CI.

Author: vcsjones
Assignees: vcsjones
Labels:

NO-MERGE, NO-REVIEW, area-System.Security, new-api-needs-documentation

Milestone: -

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vcsjones

This comment was marked as outdated.

@azure-pipelines

This comment was marked as outdated.

@vcsjones
Copy link
Member Author

/azp run runtime-ioslike, runtime-android

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@vcsjones
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vcsjones
Copy link
Member Author

Test failures appear unrelated to me. I believe this is in a re-reviewable or mergable state.

@bartonjs bartonjs merged commit 125b216 into dotnet:main Jun 1, 2023
@vcsjones vcsjones deleted the sha3 branch June 1, 2023 17:02
@vcsjones vcsjones added this to the 8.0.0 milestone Jun 1, 2023
@bartonjs bartonjs added the cryptographic-docs-impact Issues impacting cryptographic docs. Cleared and reused after documentation is updated each release. label Jun 1, 2023
IDisposable added a commit to IDisposable/dotnet-runtime that referenced this pull request Jun 7, 2023
In PR dotnet#84132, the addition of SHA3 variants to the HashAlgorithmNames was incomplete, leaving out the explicit handling of the SHA3 variants from the two helper methods:
  - `ToUpper()` - Would just return the name **unchanged** (which is likely wrong as it would allow _sha3-256_ through instead of uppercasing to _SHA3-256_. That's probably wrong.
- `ToAlgorithmName()` - Would return the `ToString()` on the supplied `hashAlgorithm` instance, which would be the classname of the argument `hashAlgorithm` (e.g. `"System.Security.Cryptography.SHA3_256"`). That would not match the expectation of `"SHA3-256"` based on the other instances.
I am not sure how important these are, or if they should be wrapped in a `#if NET8_0_OR_GREATER` wrapper (only some of the new SHA3 stuff was wrapped in that PR)
@Neustradamus
Copy link

Neustradamus commented Jun 15, 2023

@vcsjones: Thanks a lot for your work!

Linked to:

This was referenced Jun 15, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 16, 2023
@bartonjs bartonjs added tracking This issue is tracking the completion of other related issues. and removed tracking This issue is tracking the completion of other related issues. cryptographic-docs-impact Issues impacting cryptographic docs. Cleared and reused after documentation is updated each release. labels Jul 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants