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>
13 lines
214 B
C
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;
|
|
}
|