Skip to content

Commit 328cb7a

Browse files
committed
autogen: run to update randombytes() declaration
Run the autogen script to reflect the changes made to the randombytes() API. Signed-off-by: Andreas Hatziiliou <andreas.hatziiliou@savoirfairelinux.com>
1 parent bfe68e4 commit 328cb7a

25 files changed

+91
-49
lines changed

examples/basic_deterministic/mldsa_native/custom_no_randomized_config.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@
343343
* consumer.
344344
*
345345
* If this option is not set, mldsa-native expects a function
346-
* void randombytes(uint8_t *out, size_t outlen).
346+
* int randombytes(uint8_t *out, size_t outlen).
347+
* This function should return 0 on success, non-zero on failure.
347348
*
348349
* Set this option and define `mld_randombytes` if you want to
349350
* use a custom method to sample randombytes with a different name
@@ -354,9 +355,10 @@
354355
#if !defined(__ASSEMBLER__)
355356
#include <stdint.h>
356357
#include "sys.h"
357-
static MLD_INLINE void mld_randombytes(uint8_t *ptr, size_t len)
358+
static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
358359
{
359360
... your implementation ...
361+
return 0; // 0 on success, non-zero on failure
360362
}
361363
#endif
362364
*/

examples/monolithic_build/config_44.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@
341341
* consumer.
342342
*
343343
* If this option is not set, mldsa-native expects a function
344-
* void randombytes(uint8_t *out, size_t outlen).
344+
* int randombytes(uint8_t *out, size_t outlen).
345+
* This function should return 0 on success, non-zero on failure.
345346
*
346347
* Set this option and define `mld_randombytes` if you want to
347348
* use a custom method to sample randombytes with a different name
@@ -352,9 +353,10 @@
352353
#if !defined(__ASSEMBLER__)
353354
#include <stdint.h>
354355
#include "sys.h"
355-
static MLD_INLINE void mld_randombytes(uint8_t *ptr, size_t len)
356+
static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
356357
{
357358
... your implementation ...
359+
return 0; // 0 on success, non-zero on failure
358360
}
359361
#endif
360362
*/

examples/monolithic_build/config_65.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@
341341
* consumer.
342342
*
343343
* If this option is not set, mldsa-native expects a function
344-
* void randombytes(uint8_t *out, size_t outlen).
344+
* int randombytes(uint8_t *out, size_t outlen).
345+
* This function should return 0 on success, non-zero on failure.
345346
*
346347
* Set this option and define `mld_randombytes` if you want to
347348
* use a custom method to sample randombytes with a different name
@@ -352,9 +353,10 @@
352353
#if !defined(__ASSEMBLER__)
353354
#include <stdint.h>
354355
#include "sys.h"
355-
static MLD_INLINE void mld_randombytes(uint8_t *ptr, size_t len)
356+
static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
356357
{
357358
... your implementation ...
359+
return 0; // 0 on success, non-zero on failure
358360
}
359361
#endif
360362
*/

examples/monolithic_build/config_87.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@
341341
* consumer.
342342
*
343343
* If this option is not set, mldsa-native expects a function
344-
* void randombytes(uint8_t *out, size_t outlen).
344+
* int randombytes(uint8_t *out, size_t outlen).
345+
* This function should return 0 on success, non-zero on failure.
345346
*
346347
* Set this option and define `mld_randombytes` if you want to
347348
* use a custom method to sample randombytes with a different name
@@ -352,9 +353,10 @@
352353
#if !defined(__ASSEMBLER__)
353354
#include <stdint.h>
354355
#include "sys.h"
355-
static MLD_INLINE void mld_randombytes(uint8_t *ptr, size_t len)
356+
static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
356357
{
357358
... your implementation ...
359+
return 0; // 0 on success, non-zero on failure
358360
}
359361
#endif
360362
*/

examples/monolithic_build_multilevel/multilevel_config.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@
342342
* consumer.
343343
*
344344
* If this option is not set, mldsa-native expects a function
345-
* void randombytes(uint8_t *out, size_t outlen).
345+
* int randombytes(uint8_t *out, size_t outlen).
346+
* This function should return 0 on success, non-zero on failure.
346347
*
347348
* Set this option and define `mld_randombytes` if you want to
348349
* use a custom method to sample randombytes with a different name
@@ -353,9 +354,10 @@
353354
#if !defined(__ASSEMBLER__)
354355
#include <stdint.h>
355356
#include "sys.h"
356-
static MLD_INLINE void mld_randombytes(uint8_t *ptr, size_t len)
357+
static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
357358
{
358359
... your implementation ...
360+
return 0; // 0 on success, non-zero on failure
359361
}
360362
#endif
361363
*/

examples/monolithic_build_multilevel_native/multilevel_config.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@
342342
* consumer.
343343
*
344344
* If this option is not set, mldsa-native expects a function
345-
* void randombytes(uint8_t *out, size_t outlen).
345+
* int randombytes(uint8_t *out, size_t outlen).
346+
* This function should return 0 on success, non-zero on failure.
346347
*
347348
* Set this option and define `mld_randombytes` if you want to
348349
* use a custom method to sample randombytes with a different name
@@ -360,9 +361,9 @@
360361
#include <stdint.h>
361362
#include "sys.h"
362363
#include "test_only_rng/notrandombytes.h"
363-
static MLD_INLINE void mld_randombytes(uint8_t *ptr, size_t len)
364+
static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
364365
{
365-
randombytes(ptr, len);
366+
return randombytes(ptr, len);
366367
}
367368
#endif /* !__ASSEMBLER__ */
368369

examples/monolithic_build_native/config_44.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@
339339
* consumer.
340340
*
341341
* If this option is not set, mldsa-native expects a function
342-
* void randombytes(uint8_t *out, size_t outlen).
342+
* int randombytes(uint8_t *out, size_t outlen).
343+
* This function should return 0 on success, non-zero on failure.
343344
*
344345
* Set this option and define `mld_randombytes` if you want to
345346
* use a custom method to sample randombytes with a different name
@@ -350,9 +351,10 @@
350351
#if !defined(__ASSEMBLER__)
351352
#include <stdint.h>
352353
#include "sys.h"
353-
static MLD_INLINE void mld_randombytes(uint8_t *ptr, size_t len)
354+
static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
354355
{
355356
... your implementation ...
357+
return 0; // 0 on success, non-zero on failure
356358
}
357359
#endif
358360
*/

examples/monolithic_build_native/config_65.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@
339339
* consumer.
340340
*
341341
* If this option is not set, mldsa-native expects a function
342-
* void randombytes(uint8_t *out, size_t outlen).
342+
* int randombytes(uint8_t *out, size_t outlen).
343+
* This function should return 0 on success, non-zero on failure.
343344
*
344345
* Set this option and define `mld_randombytes` if you want to
345346
* use a custom method to sample randombytes with a different name
@@ -350,9 +351,10 @@
350351
#if !defined(__ASSEMBLER__)
351352
#include <stdint.h>
352353
#include "sys.h"
353-
static MLD_INLINE void mld_randombytes(uint8_t *ptr, size_t len)
354+
static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
354355
{
355356
... your implementation ...
357+
return 0; // 0 on success, non-zero on failure
356358
}
357359
#endif
358360
*/

examples/monolithic_build_native/config_87.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@
339339
* consumer.
340340
*
341341
* If this option is not set, mldsa-native expects a function
342-
* void randombytes(uint8_t *out, size_t outlen).
342+
* int randombytes(uint8_t *out, size_t outlen).
343+
* This function should return 0 on success, non-zero on failure.
343344
*
344345
* Set this option and define `mld_randombytes` if you want to
345346
* use a custom method to sample randombytes with a different name
@@ -350,9 +351,10 @@
350351
#if !defined(__ASSEMBLER__)
351352
#include <stdint.h>
352353
#include "sys.h"
353-
static MLD_INLINE void mld_randombytes(uint8_t *ptr, size_t len)
354+
static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
354355
{
355356
... your implementation ...
357+
return 0; // 0 on success, non-zero on failure
356358
}
357359
#endif
358360
*/

integration/liboqs/config_aarch64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
* consumer.
163163
*
164164
* If this option is not set, mlkem-native expects a function
165-
* void randombytes(uint8_t *out, size_t outlen).
165+
* int randombytes(uint8_t *out, size_t outlen).
166166
*
167167
* Set this option and define `mlk_randombytes` if you want to
168168
* use a custom method to sample randombytes with a different name

0 commit comments

Comments
 (0)