@@ -40,9 +40,9 @@ static int test_sign_core(uint8_t pk[CRYPTO_PUBLICKEYBYTES],
4040
4141
4242 CHECK (crypto_sign_keypair (pk , sk ) == 0 );
43- randombytes (ctx , CTXLEN );
43+ CHECK ( randombytes (ctx , CTXLEN ) == 0 );
4444 MLD_CT_TESTING_SECRET (ctx , CTXLEN );
45- randombytes (m , MLEN );
45+ CHECK ( randombytes (m , MLEN ) == 0 );
4646 MLD_CT_TESTING_SECRET (m , MLEN );
4747
4848 CHECK (crypto_sign (sm , & smlen , m , MLEN , ctx , CTXLEN , sk ) == 0 );
@@ -114,7 +114,7 @@ static int test_sign_extmu(void)
114114 size_t siglen ;
115115
116116 CHECK (crypto_sign_keypair (pk , sk ) == 0 );
117- randombytes (mu , MLDSA_CRHBYTES );
117+ CHECK ( randombytes (mu , MLDSA_CRHBYTES ) == 0 );
118118 MLD_CT_TESTING_SECRET (mu , sizeof (mu ));
119119
120120 CHECK (crypto_sign_signature_extmu (sig , & siglen , mu , sk ) == 0 );
@@ -136,11 +136,11 @@ static int test_sign_pre_hash(void)
136136
137137
138138 CHECK (crypto_sign_keypair (pk , sk ) == 0 );
139- randombytes (ctx , CTXLEN );
139+ CHECK ( randombytes (ctx , CTXLEN ) == 0 );
140140 MLD_CT_TESTING_SECRET (ctx , sizeof (ctx ));
141- randombytes (m , MLEN );
141+ CHECK ( randombytes (m , MLEN ) == 0 );
142142 MLD_CT_TESTING_SECRET (m , sizeof (m ));
143- randombytes (rnd , MLDSA_RNDBYTES );
143+ CHECK ( randombytes (rnd , MLDSA_RNDBYTES ) == 0 );
144144 MLD_CT_TESTING_SECRET (rnd , sizeof (rnd ));
145145
146146 CHECK (crypto_sign_signature_pre_hash_shake256 (sig , & siglen , m , MLEN , ctx ,
@@ -166,15 +166,15 @@ static int test_wrong_pk(void)
166166 size_t i ;
167167
168168 CHECK (crypto_sign_keypair (pk , sk ) == 0 );
169- randombytes (ctx , CTXLEN );
169+ CHECK ( randombytes (ctx , CTXLEN ) == 0 );
170170 MLD_CT_TESTING_SECRET (ctx , sizeof (ctx ));
171- randombytes (m , MLEN );
171+ CHECK ( randombytes (m , MLEN ) == 0 );
172172 MLD_CT_TESTING_SECRET (m , sizeof (m ));
173173
174174 CHECK (crypto_sign (sm , & smlen , m , MLEN , ctx , CTXLEN , sk ) == 0 );
175175
176176 /* flip bit in public key */
177- randombytes ((uint8_t * )& idx , sizeof (size_t ));
177+ CHECK ( randombytes ((uint8_t * )& idx , sizeof (size_t )) == 0 );
178178 idx %= CRYPTO_PUBLICKEYBYTES ;
179179
180180 pk [idx ] ^= 1 ;
@@ -217,15 +217,15 @@ static int test_wrong_sig(void)
217217 size_t i ;
218218
219219 CHECK (crypto_sign_keypair (pk , sk ) == 0 );
220- randombytes (ctx , CTXLEN );
220+ CHECK ( randombytes (ctx , CTXLEN ) == 0 );
221221 MLD_CT_TESTING_SECRET (ctx , sizeof (ctx ));
222- randombytes (m , MLEN );
222+ CHECK ( randombytes (m , MLEN ) == 0 );
223223 MLD_CT_TESTING_SECRET (m , sizeof (m ));
224224
225225 CHECK (crypto_sign (sm , & smlen , m , MLEN , ctx , CTXLEN , sk ) == 0 );
226226
227227 /* flip bit in signed message */
228- randombytes ((uint8_t * )& idx , sizeof (size_t ));
228+ CHECK ( randombytes ((uint8_t * )& idx , sizeof (size_t )) == 0 );
229229 idx %= MLEN + CRYPTO_BYTES ;
230230
231231 sm [idx ] ^= 1 ;
@@ -269,15 +269,15 @@ static int test_wrong_ctx(void)
269269 size_t i ;
270270
271271 CHECK (crypto_sign_keypair (pk , sk ) == 0 );
272- randombytes (ctx , CTXLEN );
272+ CHECK ( randombytes (ctx , CTXLEN ) == 0 );
273273 MLD_CT_TESTING_SECRET (ctx , sizeof (ctx ));
274- randombytes (m , MLEN );
274+ CHECK ( randombytes (m , MLEN ) == 0 );
275275 MLD_CT_TESTING_SECRET (m , sizeof (m ));
276276
277277 CHECK (crypto_sign (sm , & smlen , m , MLEN , ctx , CTXLEN , sk ) == 0 );
278278
279279 /* flip bit in ctx */
280- randombytes ((uint8_t * )& idx , sizeof (size_t ));
280+ CHECK ( randombytes ((uint8_t * )& idx , sizeof (size_t )) == 0 );
281281 idx %= CTXLEN ;
282282
283283 ctx [idx ] ^= 1 ;
0 commit comments