-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Rename SecretKey to PrivateKey for SLH-DSA #118216
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
Conversation
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
This PR renames "SecretKey" to "PrivateKey" throughout the SLH-DSA cryptographic API to align with standard cryptographic terminology. The change affects public APIs, documentation, comments, and test code while maintaining consistency with established naming conventions where private keys are distinguished from public keys.
Key changes include:
- Renaming all public API methods from
...SecretKey...
to...PrivateKey...
patterns - Updating the
SlhDsaAlgorithm.SecretKeySizeInBytes
property toPrivateKeySizeInBytes
- Adjusting test code, documentation, and variable names to reflect the new terminology
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs | Updates public API surface to rename SecretKey methods/properties to PrivateKey equivalents |
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SlhDsaOpenSsl.OpenSsl.cs | Renames ExportSlhDsaSecretKeyCore to ExportSlhDsaPrivateKeyCore in OpenSSL implementation |
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SlhDsaOpenSsl.NotSupported.cs | Updates method signature in platform not supported implementation |
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SlhDsaImplementation.OpenSsl.cs | Renames ImportSecretKey to ImportPrivateKey and updates related logic |
src/libraries/Common/src/System/Security/Cryptography/SlhDsa.cs | Updates core SlhDsa class with new PrivateKey method names and property references |
src/libraries/Common/src/System/Security/Cryptography/SlhDsaAlgorithm.cs | Renames SecretKeySizeInBytes property to PrivateKeySizeInBytes |
src/libraries/Common/src/System/Security/Cryptography/SlhDsaImplementation.cs | Updates ImportSecretKey method name and related implementation |
src/libraries/Common/src/System/Security/Cryptography/SlhDsaImplementation.Windows.cs | Updates method signatures in Windows-specific implementation |
src/libraries/Common/src/System/Security/Cryptography/SlhDsaImplementation.NotSupported.cs | Updates method signatures in not-supported implementation |
src/libraries/Common/src/System/Security/Cryptography/SlhDsaCng.cs | Updates CNG implementation method signature |
Multiple test files | Updates test methods, helpers, and data structures to use PrivateKey terminology |
...ystem.Security.Cryptography/src/System/Security/Cryptography/SlhDsaImplementation.OpenSsl.cs
Outdated
Show resolved
Hide resolved
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.
This is at least one resource string that needs to be changed (Argument_SecretKeyWrongSizeForAlgorithm
) in both S.S.C. and M.B.C. You’ll have to split it from ML-DSA (or do ML-DSA in this PR)
I did switch over SLH-DSA, and tried to delete the string. The only remaining hits for it are in ML-DSA (interestinly, MLDsaCng... the base class used a different string) |
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.
Seems correct to me, caveated on the fact that it’s harder to review for lines that should have changed but didn’t. But the public API surface looks right which is the important part.
We may want to do a breaking change doc for this one (and the ML-DSA one, if that impacts your decision on breaking ML-DSA and SLH-DSA in to two different PRs) |
I feel like the boundary condition we set for these new+Experimental types was that we didn't need docs unless we changed something after RC1. Unless I took a month-long nap, I believe that means this is still doc-free. |
When we did the But as long as we made a conscious decision, sure. |
I'll be doing the ML-DSA changes next... and by then the guilt will probably sink in and I'll make the doc for both algorithms. Particularly since I just got bit by not checking that the Pkcs library built. |
...SecretKey...
to...PrivateKey...
Fixes #117958