1111#include "common.h"
1212#include "poly.h"
1313#include "polyvec.h"
14+ #include "sys.h"
1415
1516#define crypto_sign_keypair_internal MLD_NAMESPACE(keypair_internal)
1617/*************************************************
3031 *
3132 * Returns 0 (success) or -1 (PCT failure)
3233 **************************************************/
34+ MLD_MUST_CHECK_RETURN_VALUE
3335int crypto_sign_keypair_internal (uint8_t * pk , uint8_t * sk ,
3436 const uint8_t seed [MLDSA_SEEDBYTES ])
3537__contract__ (
@@ -57,6 +59,7 @@ __contract__(
5759 *
5860 * Returns 0 (success) or -1 (PCT failure)
5961 **************************************************/
62+ MLD_MUST_CHECK_RETURN_VALUE
6063int crypto_sign_keypair (uint8_t * pk , uint8_t * sk )
6164__contract__ (
6265 requires (memory_no_alias (pk , CRYPTO_PUBLICKEYBYTES ))
@@ -92,6 +95,7 @@ __contract__(
9295 * in that it adds an explicit check for nonce exhaustion
9396 * and can return -1 in that case.
9497 **************************************************/
98+ MLD_MUST_CHECK_RETURN_VALUE
9599int crypto_sign_signature_internal (uint8_t * sig , size_t * siglen ,
96100 const uint8_t * m , size_t mlen ,
97101 const uint8_t * pre , size_t prelen ,
@@ -130,6 +134,7 @@ __contract__(
130134 *
131135 * Returns 0 (success) or -1 (context string too long OR nonce exhaustion)
132136 **************************************************/
137+ MLD_MUST_CHECK_RETURN_VALUE
133138int crypto_sign_signature (uint8_t * sig , size_t * siglen , const uint8_t * m ,
134139 size_t mlen , const uint8_t * ctx , size_t ctxlen ,
135140 const uint8_t * sk )
@@ -160,6 +165,7 @@ __contract__(
160165 *
161166 * Returns 0 (success) or -1 (context string too long OR nonce exhaustion)
162167 **************************************************/
168+ MLD_MUST_CHECK_RETURN_VALUE
163169int crypto_sign_signature_extmu (uint8_t * sig , size_t * siglen ,
164170 const uint8_t mu [MLDSA_CRHBYTES ],
165171 const uint8_t * sk )
@@ -193,6 +199,7 @@ __contract__(
193199 *
194200 * Returns 0 (success) or -1 (context string too long OR nonce exhausted)
195201 **************************************************/
202+ MLD_MUST_CHECK_RETURN_VALUE
196203int crypto_sign (uint8_t * sm , size_t * smlen , const uint8_t * m , size_t mlen ,
197204 const uint8_t * ctx , size_t ctxlen , const uint8_t * sk )
198205__contract__ (
@@ -225,6 +232,7 @@ __contract__(
225232 *
226233 * Returns 0 if signature could be verified correctly and -1 otherwise
227234 **************************************************/
235+ MLD_MUST_CHECK_RETURN_VALUE
228236int crypto_sign_verify_internal (const uint8_t * sig , size_t siglen ,
229237 const uint8_t * m , size_t mlen ,
230238 const uint8_t * pre , size_t prelen ,
@@ -256,6 +264,7 @@ __contract__(
256264 *
257265 * Returns 0 if signature could be verified correctly and -1 otherwise
258266 **************************************************/
267+ MLD_MUST_CHECK_RETURN_VALUE
259268int crypto_sign_verify (const uint8_t * sig , size_t siglen , const uint8_t * m ,
260269 size_t mlen , const uint8_t * ctx , size_t ctxlen ,
261270 const uint8_t * pk )
@@ -281,6 +290,7 @@ __contract__(
281290 *
282291 * Returns 0 if signature could be verified correctly and -1 otherwise
283292 **************************************************/
293+ MLD_MUST_CHECK_RETURN_VALUE
284294int crypto_sign_verify_extmu (const uint8_t * sig , size_t siglen ,
285295 const uint8_t mu [MLDSA_CRHBYTES ],
286296 const uint8_t * pk )
@@ -308,6 +318,7 @@ __contract__(
308318 *
309319 * Returns 0 if signed message could be verified correctly and -1 otherwise
310320 **************************************************/
321+ MLD_MUST_CHECK_RETURN_VALUE
311322int crypto_sign_open (uint8_t * m , size_t * mlen , const uint8_t * sm , size_t smlen ,
312323 const uint8_t * ctx , size_t ctxlen , const uint8_t * pk )
313324__contract__ (
0 commit comments