From 7c7f1cfacc25746dc3f8adc960933964f3d2ccec Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 27 Aug 2014 10:50:49 -0700 Subject: [PATCH] Reorder randombytes prototypes; mention that randombytes() is a compat API. --- src/libsodium/include/sodium/randombytes.h | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/libsodium/include/sodium/randombytes.h b/src/libsodium/include/sodium/randombytes.h index c5175b26..4d07cd59 100644 --- a/src/libsodium/include/sodium/randombytes.h +++ b/src/libsodium/include/sodium/randombytes.h @@ -26,29 +26,31 @@ typedef struct randombytes_implementation { } randombytes_implementation; SODIUM_EXPORT -int randombytes_set_implementation(randombytes_implementation *impl); - -SODIUM_EXPORT -void randombytes(unsigned char * const buf, const unsigned long long buf_len); - -SODIUM_EXPORT -const char *randombytes_implementation_name(void); +void randombytes_buf(void * const buf, const size_t size); SODIUM_EXPORT uint32_t randombytes_random(void); -SODIUM_EXPORT -void randombytes_stir(void); - SODIUM_EXPORT uint32_t randombytes_uniform(const uint32_t upper_bound); SODIUM_EXPORT -void randombytes_buf(void * const buf, const size_t size); +void randombytes_stir(void); SODIUM_EXPORT int randombytes_close(void); +SODIUM_EXPORT +int randombytes_set_implementation(randombytes_implementation *impl); + +SODIUM_EXPORT +const char *randombytes_implementation_name(void); + +/* -- Compatibility layer with NaCl -- */ + +SODIUM_EXPORT +void randombytes(unsigned char * const buf, const unsigned long long buf_len); + #ifdef __cplusplus } #endif