Skip to content

Commit 562f956

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 <[email protected]>
1 parent 9cfd19b commit 562f956

File tree

14 files changed

+54
-27
lines changed

14 files changed

+54
-27
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
*/

mldsa/src/config.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@
327327
* consumer.
328328
*
329329
* If this option is not set, mldsa-native expects a function
330-
* void randombytes(uint8_t *out, size_t outlen).
330+
* int randombytes(uint8_t *out, size_t outlen).
331+
* This function should return 0 on success, non-zero on failure.
331332
*
332333
* Set this option and define `mld_randombytes` if you want to
333334
* use a custom method to sample randombytes with a different name
@@ -338,9 +339,10 @@
338339
#if !defined(__ASSEMBLER__)
339340
#include <stdint.h>
340341
#include "sys.h"
341-
static MLD_INLINE void mld_randombytes(uint8_t *ptr, size_t len)
342+
static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
342343
{
343344
... your implementation ...
345+
return 0; // 0 on success, non-zero on failure
344346
}
345347
#endif
346348
*/

test/break_pct_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
*/

test/custom_memcpy_config.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ static MLD_INLINE void *mld_memcpy(void *dest, const void *src, size_t n)
350350
* consumer.
351351
*
352352
* If this option is not set, mldsa-native expects a function
353-
* void randombytes(uint8_t *out, size_t outlen).
353+
* int randombytes(uint8_t *out, size_t outlen).
354+
* This function should return 0 on success, non-zero on failure.
354355
*
355356
* Set this option and define `mld_randombytes` if you want to
356357
* use a custom method to sample randombytes with a different name
@@ -361,9 +362,10 @@ static MLD_INLINE void *mld_memcpy(void *dest, const void *src, size_t n)
361362
#if !defined(__ASSEMBLER__)
362363
#include <stdint.h>
363364
#include "sys.h"
364-
static MLD_INLINE void mld_randombytes(uint8_t *ptr, size_t len)
365+
static MLD_INLINE int mld_randombytes(uint8_t *ptr, size_t len)
365366
{
366367
... your implementation ...
368+
return 0; // 0 on success, non-zero on failure
367369
}
368370
#endif
369371
*/

test/custom_memset_config.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ static MLD_INLINE void *mld_memset(void *s, int c, size_t n)
349349
* consumer.
350350
*
351351
* If this option is not set, mldsa-native expects a function
352-
* void randombytes(uint8_t *out, size_t outlen).
352+
* int randombytes(uint8_t *out, size_t outlen).
353+
* This function should return 0 on success, non-zero on failure.
353354
*
354355
* Set this option and define `mld_randombytes` if you want to
355356
* use a custom method to sample randombytes with a different name
@@ -360,9 +361,10 @@ static MLD_INLINE void *mld_memset(void *s, int c, size_t n)
360361
#if !defined(__ASSEMBLER__)
361362
#include <stdint.h>
362363
#include "sys.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
{
365366
... your implementation ...
367+
return 0; // 0 on success, non-zero on failure
366368
}
367369
#endif
368370
*/

test/custom_randombytes_config.h

Lines changed: 2 additions & 1 deletion
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

0 commit comments

Comments
 (0)