-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
SHA3 #84132
Conversation
Note regarding the 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. |
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones Issue DetailsNot ready for review or API approved. Giving this a run through CI.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
src/libraries/Common/src/System/Security/Cryptography/HashOneShotHelpers.cs
Show resolved
Hide resolved
src/libraries/Common/src/System/Security/Cryptography/HashOneShotHelpers.cs
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
/azp run runtime-ioslike, runtime-android |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
Test failures appear unrelated to me. I believe this is in a re-reviewable or mergable state. |
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)
@vcsjones: Thanks a lot for your work! Linked to: |
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 asRfc2898DeriveBytes
,HKDF
, andSP800108HmacCounterKdf
SHAKE is not in this pull request. It will be a follow up.
Contributes to #20342