-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Rename SecretKey to PrivateKey for ML-DSA #118248
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 ML-DSA (Module-Lattice-Based Digital Signature Algorithm) implementation to align with API review decisions. The change is primarily cosmetic, updating method names, property names, variables, and resource strings while maintaining the same underlying functionality.
Key changes include:
- Renaming methods from
ExportMLDsaSecretKey
toExportMLDsaPrivateKey
andImportMLDsaSecretKey
toImportMLDsaPrivateKey
- Updating the
SecretKeySizeInBytes
property toPrivateKeySizeInBytes
inMLDsaAlgorithm
- Changing internal field names and variables from
secretKey
/hasSecretKey
toprivateKey
/hasPrivateKey
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
ref/System.Security.Cryptography.cs | Updates public API surface with renamed methods and properties |
src/System/Security/Cryptography/MLDsa*.cs | Core implementation files with renamed methods and internal state |
tests/**/*.cs | Test files updated to use new method names and variable names |
src/Resources/Strings.resx | Resource strings updated from "secret key" to "private key" |
Common/src/**/*.cs | Shared implementation code with renamed methods and variables |
Comments suppressed due to low confidence (1)
src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs:1850
- The error message resource string 'Argument_PrivateKeyWrongSizeForAlgorithm' is referenced but doesn't exist in the updated resource files. The resource files show 'Argument_SecretKeyWrongSizeForAlgorithm' was removed but no corresponding 'Argument_PrivateKeyWrongSizeForAlgorithm' was added.
{
Looks like this was missed in the COSE tests: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Security.Cryptography.Cose/tests/TestKeyRing.cs#L94 |
There's always just one more library to check... 😄 |
Added When you commit this breaking change:
Tagging @dotnet/compat for awareness of the breaking change. |
Doc template filled out: dotnet/docs#47691 |
...SecretKey... got renamed to ...PrivateKey... during the API review for ML-DSA.
Similar to the cleanup for SLH-DSA, this does not change anything in the Interop classes or the crypto shim, but should have everything else.
I did a manual check of the approved shape against the ref.cs, and it matches except for SignMu/VerifyMu (which were added in a followup review).
Fixes #117911.