zephyr/subsys/random/random_test_csprng.c
Jordan Yates bff97fbc7f random: sys_csrand_get backend for TEST_RANDOM_GENERATOR
When non-random number generation is allowed via
`TEST_RANDOM_GENERATOR`, enable an implementation for `sys_csrand_get`
that stubs out to `sys_rand_get`. This enables libraries that request
CS random numbers to be tested in CI, even if the results are not CS in
that context.

The documentation for `TEST_RANDOM_GENERATOR` is explicit enough about
the dangers of enabling this in production.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-16 10:00:47 +02:00

13 lines
214 B
C

/*
* Copyright (c) 2024 Embeint Inc
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/random/random.h>
int z_impl_sys_csrand_get(void *dst, size_t outlen)
{
sys_rand_get(dst, outlen);
return 0;
}