-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Hmac one-shot #53487
Hmac one-shot #53487
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to 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: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks Issue DetailsImplements HMAC one-shots for Linux, macOS, Windows, and Android. Closes #40012
|
Note: updates to use the one-shot where appropriate throughout libraries will be done in a follow-up PR. |
|
||
[Fact] | ||
public void HmacMD5_Rfc2202_1() | ||
{ | ||
VerifyHmac(1, "9294727a3638bb1c13f48ef8158bfc9d"); | ||
VerifyHmac(1, s_testMacs2202[1]); |
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.
IMHO this would have been more readable as single parametrized test. Then again, it is separate cleanup anyway.
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.
Yes, the tests could do with some cleanup. But I was trying my best to avoid re-writing the tests from scratch. Maybe I can do this in a follow up PR, unless someone feels strongly that "now is the time".
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.
I think I'm happy with what I came up with for non-crypto hashing tests (#53623). This could converge to something like that in a subsequent change.
I wouldn't want to hold up the API part on the test restructuring, though.
...aries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA512.cs
Outdated
Show resolved
Hide resolved
...tem.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.Unix.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Hmac.cs
Show resolved
Hide resolved
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.
Overall, looks good. Just a couple small style (code and design) things.
Implements HMAC one-shots for Linux, macOS, Windows, and Android.
Closes #40012