ML-DSA#

In ML-DSA, the size of the public key, secret key, and signature is fixed. These parameters are still provided to the implementation, but if the implementation you are testing doesn’t require them, that may be the reason why.

Parameter sets and object sizes (in bytes)#

Parameter set

Public key

Private key

Signature

44

1312

2560

2420

65

1952

4032

3309

77

2592

4896

4627

Sign#

To test a function that signs with ML-DSA, its name must conform to the following convention:

CC_MLDSA_<param set>_sign

Its signature must be:

void MLDSA_sign(
uint8_t *sig,
size_t siglen,
const uint8_t *msg,
size_t msglen,
const uint8_t *sk,
size_t sklen,
)#

Signs a message with MLDSA.

Parameters:
  • sig[Out] A buffer to store the resulting signature.

  • siglen[In] The size of the signature buffer in bytes.

  • msg[In] The message to sign.

  • msglen[In] The size of the message in bytes.

  • sk[In] The secret key to use.

  • sklen[In] The size of the secret key in bytes.

Example:

  • ML-DSA-44:

void CC_MLDSA_44_sign(uint8_t *sig, size_t siglen,
                      const uint8_t *msg, size_t msglen,
                      const uint8_t *sk, size_t sklen);

Verify#

To test a function that verifies ML-DSA signatures, its name must conform to the following convention:

CC_MLDSA_<param set>_verify

Its signature must be:

int MLDSA_verify(
const uint8_t *sig,
size_t siglen,
const uint8_t *msg,
size_t msglen,
const uint8_t *pk,
size_t pklen,
)#
Parameters:
  • sig[In] The signature to verify.

  • siglen[In] The size of the signature in bytes.

  • msg[In] The message that was signed.

  • msglen[In] The size of the message in bytes.

  • pk[In] The public key.

  • pklen[In] The size of the public key in bytes.

Returns:

The result of the verification.

Return values:
  • 0 – OK.

  • -1 – The signature is invalid.

Example:

  • ML-DSA-44:

int CC_MLDSA_44_verify(const uint8_t *sig, size_t siglen,
                       const uint8_t *msg, size_t msglen,
                       const uint8_t *pk, size_t pklen);