Skip to content

API doc: ML-DSA, ML-KEM#9686

Open
kojo1 wants to merge 4 commits intowolfSSL:masterfrom
kojo1:PQC
Open

API doc: ML-DSA, ML-KEM#9686
kojo1 wants to merge 4 commits intowolfSSL:masterfrom
kojo1:PQC

Conversation

@kojo1
Copy link
Contributor

@kojo1 kojo1 commented Jan 20, 2026

Description

Please describe the scope of the fix or feature addition.

Fixes zd#

Testing

How did you test?

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

Copy link
Contributor

@kojiws kojiws left a comment

Choose a reason for hiding this comment

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

Please check the following comments.

Copy link
Contributor

@kojiws kojiws left a comment

Choose a reason for hiding this comment

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

Could you check added comment?

kojiws
kojiws previously approved these changes Jan 21, 2026
Copy link
Contributor

@kojiws kojiws left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@anhu anhu left a comment

Choose a reason for hiding this comment

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

In each \brief section it says "This macro...."
While its true they are macros, I think it should say "This function..." or method or something else.

@kojo1
Copy link
Contributor Author

kojo1 commented Jan 21, 2026

In each \brief section it says "This macro...." ... should say "This function..."

On the same token, do you think it would be good to eliminate the wc_Dilithium_xxx lines?

This macro maps to wc_Dilithium_xxx

@anhu
Copy link
Member

anhu commented Jan 21, 2026

Yes. Eventually, that mapping will go away. Its an implementation detail, not an interface detail.

# Conflicts:
#	doc/dox_comments/header_files/doxygen_pages.h
Copy link
Member

@anhu anhu left a comment

Choose a reason for hiding this comment

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

There are many odd and troubling mistakes in here. Perhaps get another AI to review this PR as well.


\sa wc_MlDsaKey_SetParams
*/
int wc_MlDsaKey_GetParams(MlDsaKey *key, byte id);
Copy link
Member

Choose a reason for hiding this comment

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

id is not a pointer.

\sa wc_MlDsaKey_Sign
\sa wc_MlDsaKey_Verify
*/
int wc_MlDsaKey_MakeKey(MlDsaKey *key, WC_RNG *rrng);
Copy link
Member

Choose a reason for hiding this comment

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

rrng should be rng


\param key pointer to the MlDsaKey structure containing a private key
\param out output buffer for raw private key
\param outLen in/out: on input, size of out; on output, bytes written (implementation dependent)
Copy link
Member

Choose a reason for hiding this comment

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

why does it say "(implementation dependent)" ? Seems odd. Actually there are many instances of this and they all seem odd.

\sa wc_MlDsaKey_Verify
\sa wc_MlDsaKey_GetSigLen
*/
int wc_MlDsaKey_Sign(MlDsaKey *key, byte *sig, word32 sigSz, const byte *msg, word32 sgSz, WC_RNG *rng);
Copy link
Member

Choose a reason for hiding this comment

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

sgSz should be msgSz


_Example_
\code
word32 ctSz, ssSz;
Copy link
Member

Choose a reason for hiding this comment

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

would be nice if this showed RNG initialization as well.

Comment on lines +274 to +276
byte* ct = XMALLOC(ctSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
byte* ss = XMALLOC(ssSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);

Copy link
Member

Choose a reason for hiding this comment

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

I think NULLs should be sizes?

wc_MlKemKey_SharedSecretSize(&myPriv, &ssSz);

byte ss2[WC_ML_KEM_SS_SZ]; // if using fixed 32-byte SS
wc_MlKemKey_Decapsulate(&myPriv, ss2, ct, ctSz);
Copy link
Member

Choose a reason for hiding this comment

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

what is ss2?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants