summaryrefslogtreecommitdiff
path: root/test/rng_benchmark.cc
diff options
context:
space:
mode:
authorPatryk Duda <pdk@semihalf.com>2023-04-13 14:59:14 +0200
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-13 16:44:15 +0000
commit74e498c2647dcad68d46022abac34c8c5c6b96b3 (patch)
tree0f2b84c1cfe6e4e4d3328a0fa2d060291edb6cd9 /test/rng_benchmark.cc
parentcd7559374de5d6c6ef0f5b26afac1913ba871592 (diff)
downloadchrome-ec-74e498c2647dcad68d46022abac34c8c5c6b96b3.tar.gz
trng: Drop trng_rand() function
The function is not used anywhere except test/rng_benchmark.cc, so we will have a problem with code coverage when implementing the function using Zephyr API. The RNG benchmark was modified to use trng_rand_bytes() function. BUG=b:277029648 BRANCH=none TEST=./test/run_device_tests.py --board bloonchipper -t rng_benchmark Change-Id: Ic6cf7e511b2e8fe88a08e9e1c4354f7afa9ae425 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4423151 Tested-by: Patryk Duda <patrykd@google.com> Commit-Queue: Patryk Duda <patrykd@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'test/rng_benchmark.cc')
-rw-r--r--test/rng_benchmark.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/rng_benchmark.cc b/test/rng_benchmark.cc
index c086ff2cb0..10716f863d 100644
--- a/test/rng_benchmark.cc
+++ b/test/rng_benchmark.cc
@@ -31,7 +31,7 @@ test_static int test_rng()
trng_init();
auto result = benchmark.run("trng", [&trng_out]() {
static int i = 0;
- trng_out[i++] = trng_rand();
+ trng_rand_bytes(&trng_out[i++], sizeof(uint32_t));
});
trng_exit();
@@ -46,7 +46,7 @@ test_static int test_rng()
result = benchmark.run("trng_on_off", [&trng_out]() {
trng_init();
static int i = 0;
- trng_out[i++] = trng_rand();
+ trng_rand_bytes(&trng_out[i++], sizeof(uint32_t));
trng_exit();
});