Skip to content

[API Proposal]: SLH-DSA: Rename Secret Key to Private Key #117958

@vcsjones

Description

@vcsjones

Background and motivation

This is an amendment to the previously approved API review #116282 for SLH-DSA.

In the #117911 API review we renamed "secret key" to "private key" because the FIPS publication uses private key in its external names and glossary terms. FIPS 205 does the same thing, where "private key" is used significantly more than "secret key".

We should consider renaming SLH-DSA's secret key members to private key.

API Proposal

namespace System.Security.Cryptogrpahy
{
    public abstract class SlhDsa : IDisposable
    {
-       public static SlhDsa ImportSlhDsaSecretKey(SlhDsaAlgorithm algorithm, byte[] source);
+       public static SlhDsa ImportSlhDsaPrivateKey(SlhDsaAlgorithm algorithm, byte[] source);
-       public static SlhDsa ImportSlhDsaSecretKey(SlhDsaAlgorithm algorithm, ReadOnlySpan<byte> source);
+       public static SlhDsa ImportSlhDsaPrivateKey(SlhDsaAlgorithm algorithm, ReadOnlySpan<byte> source);

-       public byte[] ExportSlhDsaSecretKey();
+       public byte[] ExportSlhDsaPrivateKey();
-       public void ExportSlhDsaSecretKey(Span<byte> destination);
+       public void ExportSlhDsaPrivateKey(Span<byte> destination);
-       protected abstract void ExportSlhDsaSecretKeyCore(Span<byte> destination);
+       protected abstract void ExportSlhDsaPrivateKeyCore(Span<byte> destination);
    }

    public sealed class SlhDsaAlgorithm
    {
-       public int SecretKeySizeInBytes { get; }
+       public int PrivateKeySizeInBytes { get; }
}

API Usage

Same usage, just with different names.

Alternative Designs

No response

Risks

Breaking change in the 10.0 cycle, but these have the Experimental attribute on the classes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions