summaryrefslogtreecommitdiff
path: root/src/test/test-random-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-11-07 18:27:57 +0100
committerLennart Poettering <lennart@poettering.net>2018-11-08 09:44:27 +0100
commit3335dc2d7591fa4e5ae28efa9a2ab35fd5ba1951 (patch)
tree9aece79b3bd3c4ea6e4331bbfe98246604a7e915 /src/test/test-random-util.c
parent8d2411f69348a081419c2fb7cddbe1970cf3eac5 (diff)
downloadsystemd-3335dc2d7591fa4e5ae28efa9a2ab35fd5ba1951.tar.gz
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/test/test-random-util.c')
-rw-r--r--src/test/test-random-util.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/test-random-util.c b/src/test/test-random-util.c
index 9652a0af05..82902b7e2d 100644
--- a/src/test/test-random-util.c
+++ b/src/test/test-random-util.c
@@ -5,14 +5,14 @@
#include "log.h"
#include "tests.h"
-static void test_acquire_random_bytes(bool high_quality_required) {
+static void test_genuine_random_bytes(bool high_quality_required) {
uint8_t buf[16] = {};
unsigned i;
log_info("/* %s */", __func__);
for (i = 1; i < sizeof buf; i++) {
- assert_se(acquire_random_bytes(buf, i, high_quality_required) == 0);
+ assert_se(genuine_random_bytes(buf, i, high_quality_required) == 0);
if (i + 1 < sizeof buf)
assert_se(buf[i] == 0);
@@ -20,14 +20,14 @@ static void test_acquire_random_bytes(bool high_quality_required) {
}
}
-static void test_pseudorandom_bytes(void) {
+static void test_pseudo_random_bytes(void) {
uint8_t buf[16] = {};
unsigned i;
log_info("/* %s */", __func__);
for (i = 1; i < sizeof buf; i++) {
- pseudorandom_bytes(buf, i);
+ pseudo_random_bytes(buf, i);
if (i + 1 < sizeof buf)
assert_se(buf[i] == 0);
@@ -54,10 +54,10 @@ static void test_rdrand64(void) {
int main(int argc, char **argv) {
test_setup_logging(LOG_DEBUG);
- test_acquire_random_bytes(false);
- test_acquire_random_bytes(true);
+ test_genuine_random_bytes(false);
+ test_genuine_random_bytes(true);
- test_pseudorandom_bytes();
+ test_pseudo_random_bytes();
test_rdrand64();