The CFFI cdef declared wc_dilithium_verify_ctx_msg with word32 ctxLen while the sign variants use byte ctxLen. wolfSSL's real API (wc_MlDsaKey_VerifyCtx in wolfcrypt/wc_mldsa.h, which the wc_dilithium_verify_ctx_msg macro forwards to) takes byte ctxLen, matching FIPS 204's 255-byte context cap. The mismatched cdef made CFFI marshal a 4-byte word32 into a 1-byte slot, silently truncating any ctxLen > 255 to its low byte. Declare ctxLen as byte to match the sign cdef and the underlying API. |
||
|---|---|---|
| .. | ||
| build_ffi.py | ||