1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/random/Makefile.include
Leandro Lanzieri 531367a9a2
pkg/tinydtls: enforce the selection of a crypto secure PRNG
Also add a sanity checks on the prng_ modules.
2020-08-21 08:39:34 +02:00

16 lines
704 B
Makefile

USED_PRNG_IMPLEMENTATIONS := $(filter prng_%,$(USEMODULE))
# Check that prng_shaxprng is not used by itself
ifneq (,$(filter prng_shaxprng,$(USEMODULE)))
ifeq (,$(filter prng_sha1prng prng_sha256prng,$(USEMODULE)))
$(error prng_shaxprng should not be used directly. Select one of: prng_sha1prng, prng_sha256prng)
endif
endif
# Check that only one implementation of PRNG is used
# NOTE: prng_shaxprng is filtered out because it is used by the specific implementations
ifneq (1,$(words $(filter-out prng_shaxprng,$(USED_PRNG_IMPLEMENTATIONS))))
$(info Currently the following prng modules are used: $(USED_PRNG_IMPLEMENTATIONS))
$(error Only one implementation of PRNG should be used.)
endif