Skip to content

Conversation

@PranavSenthilnathan
Copy link
Member

Closes #118320

@PranavSenthilnathan PranavSenthilnathan added this to the 10.0.0 milestone Aug 11, 2025
@PranavSenthilnathan PranavSenthilnathan self-assigned this Aug 11, 2025
Copilot AI review requested due to automatic review settings August 11, 2025 18:41
Copy link
Contributor

Copilot AI left a 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 bool with out int bytesWritten to returning int directly
  • 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

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

@PranavSenthilnathan
Copy link
Member Author

/cc @jeffhandley @artl93 Updating PQC APIs for RC1 based on API Review approval

@PranavSenthilnathan PranavSenthilnathan merged commit 6bc502f into dotnet:main Aug 13, 2025
79 of 82 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Composite ML-DSA

2 participants