-
Couldn't load subscription status.
- Fork 5.2k
Update Composite ML-DSA import/export APIs #118600
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
Update Composite ML-DSA import/export APIs #118600
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 refactors the Composite ML-DSA import/export APIs to replace the Try*Core pattern with direct export methods that return byte counts instead of boolean success indicators. The change simplifies the API design by moving error handling logic out of the core methods.
Key changes include:
- Changed core export methods from returning
boolwithout int bytesWrittento returningintdirectly - Introduced new overloads that export directly to
Span<byte>destinations - Refactored size validation logic to use min/max bounds instead of complex size range objects
- Updated test infrastructure to match the new API patterns
Reviewed Changes
Copilot reviewed 12 out of 12 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 | Added new export overloads and updated abstract method signatures |
| src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CompositeMLDsaImplementation.*.cs | Updated platform-specific implementations to use new export signatures |
| src/libraries/Common/src/System/Security/Cryptography/CompositeMLDsaManaged.cs | Refactored managed implementation to use direct return values instead of out parameters |
| src/libraries/Common/src/System/Security/Cryptography/CompositeMLDsaAlgorithm.cs | Replaced complex SizeRange system with simple min/max bounds and validation methods |
| src/libraries/Common/src/System/Security/Cryptography/CompositeMLDsa.cs | Updated export methods to use new core APIs and added Span-based overloads |
| src/libraries/Common/src/System/Security/Cryptography/CryptoPool.cs | Added IsRented property for conditional buffer management |
| src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/CompositeMLDsa/*.cs | Updated tests to match new API patterns and added comprehensive test coverage |
src/libraries/Common/src/System/Security/Cryptography/CompositeMLDsaAlgorithm.cs
Outdated
Show resolved
Hide resolved
|
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones |
|
/cc @jeffhandley @artl93 Updating PQC APIs for RC1 based on API Review approval |
Closes #118320