diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-11-07 18:27:57 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-11-08 09:44:27 +0100 |
commit | 3335dc2d7591fa4e5ae28efa9a2ab35fd5ba1951 (patch) | |
tree | 9aece79b3bd3c4ea6e4331bbfe98246604a7e915 /src/basic/random-util.h | |
parent | Merge pull request #10682 from yuwata/fix-oss-fuzz-network-issues (diff) | |
download | systemd-3335dc2d7591fa4e5ae28efa9a2ab35fd5ba1951.tar.xz systemd-3335dc2d7591fa4e5ae28efa9a2ab35fd5ba1951.zip |
random-util: rename acquire_random_bytes() → genuine_random_bytes()
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.
Diffstat (limited to 'src/basic/random-util.h')
-rw-r--r-- | src/basic/random-util.h | 7 |
1 files changed, 4 insertions, 3 deletions
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 <stddef.h> #include <stdint.h> -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) { |