Merge pull request #17188 from benpicco/sys/random-musl_lcg-default

sys/random: default to musl LCG instead of TinyMT
This commit is contained in:
benpicco 2021-11-30 23:28:48 +01:00 committed by GitHub
commit 207964265a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 27 additions and 27 deletions

View File

@ -42,7 +42,7 @@ endif
ifneq (,$(filter random,$(USEMODULE)))
# select default prng if no prng is selected
ifeq (,$(filter prng_%,$(USEMODULE)))
USEMODULE += prng_tinymt32
USEMODULE += prng_musl_lcg
endif
endif

View File

@ -17,7 +17,7 @@ choice RANDOM_IMPLEMENTATION
bool "PRNG Implementation"
depends on TEST_KCONFIG
default MODULE_PRNG_HWRNG if HAS_PERIPH_HWRNG
default MODULE_PRNG_TINYMT32
default MODULE_PRNG_MUSL_LCG
menuconfig MODULE_PRNG_FORTUNA
bool "Fortuna"

View File

@ -1,3 +1,3 @@
USEMODULE += random
# Set a different prng than the default prng_tinymt32
# Set a different prng than the default
USEMODULE += prng_xorshift

View File

@ -3,5 +3,5 @@ CONFIG_MODULE_RANDOM=y
# Should be autoselecting the MODULE_PRNG_HWRNG if possible
# Since the makefile cannot we have to override until end of migration
# Remove when TEST_KCONFIG is complete
CONFIG_MODULE_PRNG_TINYMT32=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_PACKAGE_C25519=y

View File

@ -3,5 +3,5 @@ CONFIG_MODULE_RANDOM=y
# Should be autoselecting the MODULE_PRNG_HWRNG if possible
# Since the makefile cannot we have to override until end of migration
# Remove when TEST_KCONFIG is complete
CONFIG_MODULE_PRNG_TINYMT32=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_PACKAGE_CIFRA=y

View File

@ -3,5 +3,5 @@ CONFIG_MODULE_RANDOM=y
# Should be autoselecting the MODULE_PRNG_HWRNG if possible
# Since the makefile cannot we have to override until end of migration
# Remove when TEST_KCONFIG is complete
CONFIG_MODULE_PRNG_TINYMT32=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_PACKAGE_HACL=y

View File

@ -4,7 +4,7 @@ CONFIG_MODULE_MEMARRAY=y
# Should be autoselecting the MODULE_PRNG_HWRNG if possible
# Since the makefile cannot we have to override until end of migration
# Remove when TEST_KCONFIG is complete
CONFIG_MODULE_PRNG_TINYMT32=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_MODULE_RANDOM=y
CONFIG_PACKAGE_HACL=y
CONFIG_PACKAGE_LIBCOSE=y

View File

@ -3,5 +3,5 @@ CONFIG_MODULE_RANDOM=y
# Should be autoselecting the MODULE_PRNG_HWRNG if possible
# Since the makefile cannot we have to override until end of migration
# Remove when TEST_KCONFIG is complete
CONFIG_MODULE_PRNG_TINYMT32=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_PACKAGE_LIBHYDROGEN=y

View File

@ -3,5 +3,5 @@ CONFIG_MODULE_RANDOM=y
# Should be autoselecting the MODULE_PRNG_HWRNG if possible
# Since the makefile cannot we have to override until end of migration
# Remove when TEST_KCONFIG is complete
CONFIG_MODULE_PRNG_TINYMT32=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_PACKAGE_MICRO-ECC=y

View File

@ -3,5 +3,5 @@ CONFIG_MODULE_RANDOM=y
# Should be autoselecting the MODULE_PRNG_HWRNG if possible
# Since the makefile cannot we have to override until end of migration
# Remove when TEST_KCONFIG is complete
CONFIG_MODULE_PRNG_TINYMT32=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_PACKAGE_MONOCYPHER=y

View File

@ -3,5 +3,5 @@ CONFIG_MODULE_RANDOM=y
# Should be autoselecting the MODULE_PRNG_HWRNG if possible
# Since the makefile cannot we have to override until end of migration
# Remove when TEST_KCONFIG is complete
CONFIG_MODULE_PRNG_TINYMT32=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_PACKAGE_QDSA=y

View File

@ -3,5 +3,5 @@ CONFIG_MODULE_RANDOM=y
# Should be autoselecting the MODULE_PRNG_HWRNG if possible
# Since the makefile cannot we have to override until end of migration
# Remove when TEST_KCONFIG is complete
CONFIG_MODULE_PRNG_TINYMT32=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_PACKAGE_TWEETNACL=y

View File

@ -20,7 +20,7 @@ def testfunc(child):
child.expect_exact("> ")
child.sendline("fips")
child.expect_exact("Running FIPS 140-2 test, with seed 1337 using Tiny Mersenne Twister PRNG.")
child.expect_exact("Running FIPS 140-2 test, with seed 1337 using Musl C PRNG.")
child.expect("Monobit test: passed")
child.expect("Poker test: passed")
child.expect("Run test: passed")
@ -28,21 +28,21 @@ def testfunc(child):
child.expect_exact("> ")
child.sendline("dump 10")
child.expect_exact("Running dump test, with seed 1337 using Tiny Mersenne Twister PRNG.")
child.expect("1555530734")
child.expect("2178333451")
child.expect("2272913641")
child.expect("3790481823")
child.expect("3190025502")
child.expect("798555366")
child.expect("1918982324")
child.expect("1550167154")
child.expect("3454972398")
child.expect("1034066532")
child.expect_exact("Running dump test, with seed 1337 using Musl C PRNG.")
child.expect("3954330727")
child.expect("188121509")
child.expect("1069019535")
child.expect("1187072490")
child.expect("4172651676")
child.expect("2421580254")
child.expect("2126354391")
child.expect("1784094822")
child.expect("751721632")
child.expect("679714536")
child.expect_exact("> ")
child.sendline("entropy")
child.expect(re.compile(r"Calculated 7\.994\d{3} bits of entropy from 10000 samples\."))
child.expect(re.compile(r"Calculated 7\.995\d{3} bits of entropy from 10000 samples\."))
child.expect_exact("> ")
# Constant source

View File

@ -4,5 +4,5 @@ CONFIG_MODULE_ATOMIC_UTILS=y
CONFIG_MODULE_FMT=y
CONFIG_MODULE_SHELL=y
CONFIG_MODULE_RANDOM=y
CONFIG_MODULE_PRNG_TINYMT32=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_MODULE_XTIMER=y

View File

@ -4,4 +4,4 @@ CONFIG_MODULE_EMBUNIT=y
CONFIG_MODULE_ATOMIC_UTILS=y
CONFIG_MODULE_RANDOM=y
# Force tinymt32 to be selected
CONFIG_MODULE_PRNG_TINYMT32=y
CONFIG_MODULE_PRNG_MUSL_LCG=y