Skip to content

Commit b701069

Browse files
hanno-beckermkannwischer
authored andcommitted
API: Document what TRBYTES is useful for
TRBYTES is the size of the public-key hash. It is a public interface of the ML-DSA family: callers of the external-mu API that compute the message representative mu themselves (e.g. to sign or verify a large or streamed message that does not fit in RAM) need it to size their TR buffer. Expand the comment on MLDSA_TRBYTES in mldsa_native.h to explain this, so the constant is not mistaken for a purely internal value again. See #1267 (comment) Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>
1 parent 6b3d460 commit b701069

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

mldsa/mldsa_native.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@
6262
#define MLDSA65_CRHBYTES MLDSA_CRHBYTES
6363
#define MLDSA87_CRHBYTES MLDSA_CRHBYTES
6464

65-
/* Size of TR output in bytes (level-independent) */
65+
/* Size of TR in bytes (level-independent)
66+
*
67+
* TR = SHAKE256(pk, 64) is the hash of the public key. Callers of the
68+
* external-mu API (signature_extmu / verify_extmu) that compute the message
69+
* representative mu = SHAKE256(TR || M', MLDSA_CRHBYTES) themselves -- e.g. to
70+
* sign or verify a message that is too large or streamed to hold in memory --
71+
* need this constant to size the TR buffer. */
6672
#define MLDSA_TRBYTES 64
6773
#define MLDSA44_TRBYTES MLDSA_TRBYTES
6874
#define MLDSA65_TRBYTES MLDSA_TRBYTES

0 commit comments

Comments
 (0)