2019-04-06 15:08:09 +02:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2019-07-23 21:16:24 +02:00
|
|
|
if (CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR OR
|
2023-01-09 10:54:44 +01:00
|
|
|
CONFIG_TIMER_RANDOM_GENERATOR OR
|
2021-07-25 09:45:10 +02:00
|
|
|
CONFIG_XOSHIRO_RANDOM_GENERATOR)
|
2023-10-07 00:38:53 +02:00
|
|
|
zephyr_syscall_header(${ZEPHYR_BASE}/include/zephyr/random/random.h)
|
2019-07-23 21:16:24 +02:00
|
|
|
zephyr_library()
|
2020-06-04 20:00:45 +02:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_USERSPACE rand32_handlers.c)
|
2019-07-23 21:16:24 +02:00
|
|
|
endif()
|
|
|
|
|
2022-12-13 21:30:26 +01:00
|
|
|
if (CONFIG_TIMER_RANDOM_GENERATOR)
|
2020-09-19 07:34:06 +02:00
|
|
|
message(WARNING "
|
2022-12-13 21:30:26 +01:00
|
|
|
Warning: CONFIG_TIMER_RANDOM_GENERATOR is not a truly random generator.
|
2020-09-19 07:34:06 +02:00
|
|
|
This capability is not secure and it is provided for testing purposes only.
|
|
|
|
Use it carefully.")
|
|
|
|
endif()
|
|
|
|
|
2023-01-09 10:54:44 +01:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_TIMER_RANDOM_GENERATOR rand32_timer.c)
|
2021-07-25 09:45:10 +02:00
|
|
|
zephyr_library_sources_ifdef(CONFIG_XOSHIRO_RANDOM_GENERATOR rand32_xoshiro128.c)
|
|
|
|
zephyr_library_sources_ifdef(CONFIG_CTR_DRBG_CSPRNG_GENERATOR rand32_ctr_drbg.c)
|
2019-07-23 21:16:24 +02:00
|
|
|
|
|
|
|
if (CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR OR CONFIG_HARDWARE_DEVICE_CS_GENERATOR)
|
|
|
|
zephyr_library_sources(rand32_entropy_device.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (CONFIG_CTR_DRBG_CSPRNG_GENERATOR)
|
|
|
|
zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)
|
|
|
|
endif()
|