Skip to content

Unify documentation for ML-DSA and SLH-DSA #115760

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

Closed
wants to merge 5 commits into from
Closed

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented May 20, 2025

This PR addresses inconsistencies in documentation between ML-DSA and SLH-DSA cryptography classes. These are similar post-quantum cryptography algorithm implementations that should maintain consistent documentation patterns.

Changes:

  1. SlhDsa.cs: Updated to use <see cref="SlhDsa"/> instead of <c>SlhDsa</c> in remarks section for consistency with MLDsa

  2. MLDsaAlgorithm.cs:

    • Added detailed XML documentation for the Oid property to match SlhDsaAlgorithm
    • Updated parameter documentation for the constructor to be more descriptive
    • Added reference to FIPS 204 specification (similar to the FIPS 205 reference in SlhDsaAlgorithm)
  3. SlhDsaOpenSsl.cs: Fixed indentation in DuplicateKeyHandle method documentation to match formatting style in MLDsaOpenSsl.cs

These changes ensure that both API families follow the same documentation style and provide comparable levels of detail, making the cryptography APIs more consistent for developers.

Fixes #115759.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@dotnet-policy-service dotnet-policy-service bot added linkable-framework Issues associated with delivering a linker friendly framework labels May 20, 2025
Co-authored-by: PranavSenthilnathan <12225508+PranavSenthilnathan@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Unify documentation for ML-DSA and SLH-DSA Unify documentation for ML-DSA and SLH-DSA May 20, 2025
@Copilot Copilot AI requested a review from PranavSenthilnathan May 20, 2025 06:26
Copilot finished work on behalf of PranavSenthilnathan May 20, 2025 06:26
Comment on lines 89 to 91
// ML-DSA parameter sets, and the sizes associated with them,
// are defined in FIPS 204, "CRYSTALS-Dilithium: Digital Signature Algorithm
// Specification"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO hasn't been addressed yet so leave it in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've restored the TODO comments that were inadvertently removed. The original TODO comments are now back in place. 9ad6c46

@@ -51,7 +51,13 @@ public sealed class MLDsaAlgorithm
/// </value>
public int SignatureSizeInBytes { get; }

internal string Oid { get; }
/// <summary>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spacing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the spacing issue in the Oid property documentation to match the rest of the file. 9ad6c46

@@ -57,7 +57,7 @@ public SlhDsaOpenSsl(SafeEvpPKeyHandle pkeyHandle) : base(AlgorithmFromHandle(pk
private static partial SlhDsaAlgorithm AlgorithmFromHandle(SafeEvpPKeyHandle pkeyHandle, out SafeEvpPKeyHandle upRefHandle);

/// <summary>
/// Gets a <see cref="SafeEvpPKeyHandle" /> representation of the cryptographic key.
/// Gets a <see cref="SafeEvpPKeyHandle" /> representation of the cryptographic key.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any other related files that have this same indenting issue? Fix them too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed the indentation issue in DuplicateKeyHandle documentation for all related files. Similar indentation issues were found and fixed in MLKemOpenSsl.cs. b2887dd

@@ -14,7 +14,7 @@ namespace System.Security.Cryptography
/// Represents an SLH-DSA key.
/// </summary>
/// <remarks>
/// Developers are encouraged to program against the <c>SlhDsa</c> base class,
/// Developers are encouraged to program against the <see cref="SlhDsa"/> base class,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix other related files that have the same issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated all related cryptography class documentation for consistency. Changed all instances of <c>SlhDsa</c>, <c>MLDsa</c>, and <c>MLKem</c> to use the <see cref="..."/> tag instead in SlhDsaOpenSsl.cs, MLDsaOpenSsl.cs, MLKemOpenSsl.cs, and MLKem.cs. b2887dd

Copy link
Member

@PranavSenthilnathan PranavSenthilnathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

Co-authored-by: PranavSenthilnathan <12225508+PranavSenthilnathan@users.noreply.github.com>
Copilot AI and others added 2 commits May 20, 2025 06:50
Co-authored-by: PranavSenthilnathan <12225508+PranavSenthilnathan@users.noreply.github.com>
Co-authored-by: PranavSenthilnathan <12225508+PranavSenthilnathan@users.noreply.github.com>
Copilot finished work on behalf of PranavSenthilnathan May 20, 2025 06:56
@jkotas jkotas added area-System.Security and removed linkable-framework Issues associated with delivering a linker friendly framework labels May 20, 2025
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify documentation for ML-DSA and SLH-DSA
3 participants