-
Notifications
You must be signed in to change notification settings - Fork 5.2k
KMAC Verify #119912
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
KMAC Verify #119912
Conversation
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones |
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.
Pull Request Overview
Adds verification capabilities to KMAC APIs (Kmac128/256 and KmacXof128/256), enabling one-shot and streaming hash verification plus instance-level verification of current and reset hashes. Expands test coverage for valid/invalid cases, argument validation, cancellation, platform not supported paths, and cryptographic edge scenarios. Introduces shared internal generic helper (KmacStatic) to consolidate verification logic.
- Adds instance methods: VerifyCurrentHash and VerifyHashAndReset
- Adds static one-shot and streaming Verify / VerifyAsync APIs (byte[], span, stream overloads)
- Adds comprehensive positive/negative test coverage and supporting infrastructure (KmacStatic helper, trait updates)
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
KmacXof256Tests.cs | Adds test trait wrappers for new verify APIs. |
KmacXof128Tests.cs | Same as above for 128-bit XOF variant. |
KmacTestDriver.cs | Adds extensive test coverage for verification success/failure and argument validation. |
Kmac256Tests.cs | Adds trait wrappers for fixed-length 256-bit variant. |
Kmac128Tests.cs | Adds trait wrappers for fixed-length 128-bit variant. |
KmacXof256.cs | Adds instance and static verification APIs for KMACXOF256. |
KmacXof128.cs | Adds instance and static verification APIs for KMACXOF128. |
KmacStatic.cs | New internal generic helper implementing shared verification logic. |
Kmac256.cs | Adds instance and static verification APIs for KMAC256. |
Kmac128.cs | Adds instance and static verification APIs for KMAC128. |
ConcurrentSafeKmac.cs | Adds internal verification helpers for current and finalize+reset paths. |
System.Security.Cryptography.csproj | Includes new KmacStatic.cs file in build. |
Strings.resx | Adds resource string for empty-hash argument validation. |
System.Security.Cryptography.cs (ref) | Exposes new public API surface for verification methods. |
Closes #116028