From 3335dc2d7591fa4e5ae28efa9a2ab35fd5ba1951 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 7 Nov 2018 18:27:57 +0100 Subject: random-util: rename acquire_random_bytes() → genuine_random_bytes() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's more descriptive, since we also have a function random_bytes() which sounds very similar. Also rename pseudorandom_bytes() to pseudo_random_bytes(). This way the two functions are nicely systematic, one returning genuine random bytes and the other pseudo random ones. --- src/basic/random-util.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/basic/random-util.h') diff --git a/src/basic/random-util.h b/src/basic/random-util.h index affcc9ac1d..0429ea5e52 100644 --- a/src/basic/random-util.h +++ b/src/basic/random-util.h @@ -5,9 +5,10 @@ #include #include -int acquire_random_bytes(void *p, size_t n, bool high_quality_required); -void pseudorandom_bytes(void *p, size_t n); -void random_bytes(void *p, size_t n); +int genuine_random_bytes(void *p, size_t n, bool high_quality_required); /* returns "genuine" randomness, optionally filled upwith pseudo random, if not enough is available */ +void pseudo_random_bytes(void *p, size_t n); /* returns only pseudo-randommess (but possibly seeded from something better) */ +void random_bytes(void *p, size_t n); /* returns genuine randomness if cheaply available, and pseudo randomness if not. */ + void initialize_srand(void); static inline uint64_t random_u64(void) { -- cgit v1.2.3