1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #15817 from leandrolanzieri/pr/kconfig/sys_crypto

sys/{crypto, hashes, random}: add modules to Kconfig
This commit is contained in:
Francisco 2021-01-27 10:20:11 +01:00 committed by GitHub
commit dc801b9dde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 212 additions and 2 deletions

View File

@ -24,8 +24,8 @@ tests/driver_mq3 tests/driver_my9221 tests/driver_nvram_spi tests/mtd_flashpage
tests/mtd_mapper tests/driver_o* tests/driver_p* tests/driver_q*
tests/driver_r* tests/driver_s* tests/driver_t* tests/driver_u*
tests/driver_v*"}
: ${TEST_KCONFIG_native:="examples/hello-world tests/periph_*
tests/xtimer_* tests/ztimer_* tests/driver_ws281x"}
: ${TEST_KCONFIG_native:="examples/hello-world tests/periph_* tests/sys_crypto
tests/prng_* tests/xtimer_* tests/ztimer_* tests/driver_ws281x"}
: ${TEST_WITH_CONFIG_SUPPORTED:="examples/suit_update tests/driver_at86rf2xx_aes"}

View File

@ -11,14 +11,17 @@ rsource "auto_init/Kconfig"
rsource "benchmark/Kconfig"
rsource "checksum/Kconfig"
rsource "color/Kconfig"
rsource "crypto/Kconfig"
rsource "div/Kconfig"
rsource "embunit/Kconfig"
rsource "entropy_source/Kconfig"
rsource "event/Kconfig"
rsource "fmt/Kconfig"
rsource "frac/Kconfig"
rsource "hashes/Kconfig"
rsource "iolist/Kconfig"
rsource "isrpipe/Kconfig"
rsource "luid/Kconfig"
rsource "malloc_thread_safe/Kconfig"
rsource "net/Kconfig"
rsource "Kconfig.newlib"
@ -27,6 +30,7 @@ rsource "od/Kconfig"
rsource "phydat/Kconfig"
rsource "pm_layered/Kconfig"
rsource "ps/Kconfig"
rsource "random/Kconfig"
rsource "saul_reg/Kconfig"
rsource "schedstatistics/Kconfig"
rsource "shell/Kconfig"

47
sys/crypto/Kconfig Normal file
View File

@ -0,0 +1,47 @@
# Copyright (c) 2021 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
menu "Crypto"
config MODULE_CRYPTO
bool "Common cryptographic functionalities"
depends on TEST_KCONFIG
choice
bool "Crypto block ciphers API implementation"
optional
depends on TEST_KCONFIG
help
The common Crypto block ciphers API has multiple implementations. Choose
one of the following.
config MODULE_CRYPTO_AES
bool "AES"
select MODULE_CRYPTO
config MODULE_CRYPTO_3DES
bool "3DES (deprecated)"
select MODULE_CRYPTO
endchoice
menu "Crypto AES options"
depends on MODULE_CRYPTO_AES
config MODULE_CRYPTO_AES_PRECALCULATED
bool "Pre-calculate T tables"
config MODULE_CRYPTO_AES_UNROLL
bool "Unroll loop in AES"
help
This unrolls a loop in AES, but it uses more flash.
endmenu # Crypto AES options
rsource "modes/Kconfig"
endmenu # Crypto

12
sys/crypto/modes/Kconfig Normal file
View File

@ -0,0 +1,12 @@
# Copyright (c) 2021 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
config MODULE_CIPHER_MODES
bool "Modes for block ciphers"
depends on MODULE_CRYPTO
help
Include common code for block cipher modes, such as CBC, ECB or OCB.

11
sys/hashes/Kconfig Normal file
View File

@ -0,0 +1,11 @@
# Copyright (c) 2021 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
config MODULE_HASHES
bool "Hash algorithms"
depends on TEST_KCONFIG
select MODULE_CRYPTO

11
sys/luid/Kconfig Normal file
View File

@ -0,0 +1,11 @@
# Copyright (c) 2021 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
config MODULE_LUID
bool "Locally Unique ID Generator"
depends on TEST_KCONFIG
select MODULE_PERIPH_CPUID if HAS_PERIPH_CPUID

82
sys/random/Kconfig Normal file
View File

@ -0,0 +1,82 @@
# Copyright (c) 2021 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
menuconfig MODULE_RANDOM
bool "Pseudo-Random Number Generation"
depends on TEST_KCONFIG
select MODULE_LUID
select MODULE_PERIPH_HWRNG if HAS_PERIPH_HWRNG && !MODULE_PUF_SRAM
if MODULE_RANDOM
choice RANDOM_IMPLEMENTATION
bool "PRNG Implementation"
depends on TEST_KCONFIG
default MODULE_PRNG_HWRNG if HAS_PERIPH_HWRNG
default MODULE_PRNG_TINYM32
config MODULE_PRNG_FORTUNA
bool "Fortuna"
select MODULE_HASHES
select MODULE_XTIMER
select MODULE_FORTUNA
select MODULE_CRYPTO
depends on MODULE_CRYPTO_AES
config MODULE_PRNG_HWRNG
bool "Hardware RNG"
depends on HAS_PERIPH_HWRNG
select MODULE_PERIPH_HWRNG
config MODULE_PRNG_MARSENNE
bool "Marsenne"
config MODULE_PRNG_MINISTD
bool "Mini STD"
config MODULE_PRNG_MUSL_LCG
bool "MUSL LCG"
config MODULE_PRNG_SHA1PRNG
bool "SHA-1"
select MODULE_PRNG_SHAXPRNG
select MODULE_HASHES
config MODULE_PRNG_SHA256PRNG
bool "SHA-256"
select MODULE_PRNG_SHAXPRNG
select MODULE_HASHES
config MODULE_PRNG_TINYM32
bool "Tiny-MT 32"
select MODULE_TINYMT32
config MODULE_PRNG_XORSHIFT
bool "XOR Shift"
endchoice # RANDOM_IMPLEMENTATION
config MODULE_AUTO_INIT_RANDOM
bool "Auto-initialize the random subsystem"
default y
depends on MODULE_AUTO_INIT
config MODULE_PRNG_SHAXPRNG
bool
help
Unified implementation for SHA-256 and SHA-1 PRNG.
config MODULE_PRNG
bool
default y
help
Basic Pseudo-random number generation module.
rsource "fortuna/Kconfig"
rsource "tinymt32/Kconfig"
endif # MODULE_RANDOM

View File

@ -0,0 +1,13 @@
# Copyright (c) 2021 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
config MODULE_FORTUNA
bool
depends on TEST_KCONFIG
help
Fortuna pseudo-random number generation. This is not your general
purpose PRNG: it is hungry for memory.

View File

@ -0,0 +1,12 @@
# Copyright (c) 2021 HAW Hamburg
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
config MODULE_TINYMT32
bool
depends on TEST_KCONFIG
help
Tiny Mersenne Twister only 127 bit internal state.

View File

@ -0,0 +1,5 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_RANDOM=y
CONFIG_MODULE_PRNG_SHA1PRNG=y
CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y

View File

@ -0,0 +1,5 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_RANDOM=y
CONFIG_MODULE_PRNG_SHA256PRNG=y
CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y

View File

@ -0,0 +1,8 @@
# this file enables modules defined in Kconfig. Do not use this file for
# application configuration. This is only needed during migration.
CONFIG_MODULE_CRYPTO_3DES=y
CONFIG_MODULE_CIPHER_MODES=y
CONFIG_MODULE_EMBUNIT=y
CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y