./
Coverage:
low: ≥ 0%
medium: ≥ 50.0%
high: ≥ 80.0%
Lines:
0 / 11
0.0%
Branches:
0 / 8
0.0%
Functions:
0 / 1
0.0%

kfsw-modules/radio-uhf/src/radio_crypto_host.c
Line Branch Exec Source
1 #include <errno.h>
2 #include <stddef.h>
3 #include <stdint.h>
4 #include <sys/random.h>
5
6 /* Built with host headers, not Zephyr's libc. native_sim's default entropy
7 * driver is a repeatable test generator.
8 */
9 ✗ int kfsw_radio_host_random(void *data, size_t size)
10 {
11 ✗ uint8_t *out = data;
12
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ while (size != 0U) {
13 ✗ ssize_t count = getrandom(out, size, 0);
14
0/4
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ if (count < 0 && errno == EINTR) {
15 ✗ continue;
16 }
17
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ if (count <= 0) {
18 ✗ return -1;
19 }
20 ✗ out += count;
21 ✗ size -= (size_t)count;
22 }
23 ✗ return 0;
24 }
25