|
17 | 17 | * It uses a "Zephyr entropy driver" and can therefore only be used in |
18 | 18 | * Zephyr images. |
19 | 19 | * |
20 | | - * This is used for two uses cases, the first use case is when hardware |
21 | | - * crypto/entropy is not yet supported. This enables running software crypto |
22 | | - * with a non cryptographically secure random generator to unblock development |
23 | | - * when the device tree node with the DT label 'prng' is enabled. |
| 20 | + * Note that it is only the device driver with the DT label 'rng' that |
| 21 | + * is supported and that this rng label is only applied for the Zephyr |
| 22 | + * driver that uses the HW peripheral NRF_RNG (entropy_nrf5.c). |
24 | 23 | * |
25 | | - * The second use case is for instance nrf52820 which has an NRF_RNG |
| 24 | + * An intended use-case is for instance nrf52820 which has an NRF_RNG |
26 | 25 | * peripheral, but does not have a HW crypto trng like cryptocell. |
27 | | - * In this use case the device driver with the DT label 'rng' |
28 | | - * is supported and this rng label is only applied for the Zephyr |
29 | | - * driver that uses the HW peripheral NRF_RNG (entropy_nrf5.c). |
30 | 26 | * |
31 | 27 | * Note that NRF_RNG produces TRNG, not CSPRNG. |
32 | 28 | */ |
33 | | -#ifdef CONFIG_FAKE_ENTROPY_NRF_PRNG |
34 | | -#define DTS_RNG_NODE_LABEL prng |
35 | | -#else |
36 | | -#define DTS_RNG_NODE_LABEL rng |
37 | | -#endif |
38 | | - |
39 | 29 | psa_status_t nrf_rng_get_entropy(uint32_t flags, size_t *estimate_bits, uint8_t *output, |
40 | 30 | size_t output_size) |
41 | 31 | { |
42 | | - const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(DTS_RNG_NODE_LABEL)); |
| 32 | + const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(rng)); |
43 | 33 | uint16_t request_len = MIN(UINT16_MAX, output_size); |
44 | 34 | int err; |
45 | 35 |
|
|
0 commit comments