1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/psa_crypto/Makefile.dep
2024-10-17 10:25:59 +02:00

467 lines
14 KiB
Makefile

ifneq (,$(filter psa_crypto,$(USEMODULE)))
USEMODULE += random
USEMODULE += prng_sha256prng
endif
ifneq (,$(filter psa_persistent_storage, $(USEMODULE)))
USEPKG += nanocbor
USEPKG += littlefs2
USEMODULE += vfs
USEMODULE += vfs_default
USEMODULE += vfs_auto_format
USEMODULE += vfs_auto_mount
endif
# Asymmetric
ifneq (,$(filter psa_asymmetric,$(USEMODULE)))
USEMODULE += psa_key_management
endif
## ECC_P192R1 backend
ifneq (,$(filter psa_asymmetric_ecc_p192r1,$(USEMODULE)))
ifeq (,$(filter psa_asymmetric_ecc_p192r1_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_ecc_p192r1
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_ecc_p192r1,$(FEATURES_USED)))
USEMODULE += psa_asymmetric_ecc_p192r1_backend_periph
else
USEMODULE += psa_asymmetric_ecc_p192r1_backend_microecc
endif
endif
endif
ifneq (,$(filter psa_asymmetric_ecc_p192r1_backend_microecc, $(USEMODULE)))
USEPKG += micro-ecc
USEMODULE += psa_uecc
USEMODULE += psa_uecc_p192
endif
ifneq (,$(filter psa_asymmetric_ecc_p192r1_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_ecc_p192r1
endif
## ECC_P256R1 backend
ifneq (,$(filter psa_asymmetric_ecc_p256r1,$(USEMODULE)))
ifeq (,$(filter psa_asymmetric_ecc_p256r1_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_ecc_p256r1
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_ecc_p256r1,$(FEATURES_USED)))
USEMODULE += psa_asymmetric_ecc_p256r1_backend_periph
else
USEMODULE += psa_asymmetric_ecc_p256r1_backend_microecc
endif
endif
endif
ifneq (,$(filter psa_asymmetric_ecc_p256r1_backend_microecc,$(USEMODULE)))
USEPKG += micro-ecc
USEMODULE += psa_uecc
USEMODULE += psa_uecc_p256
endif
ifneq (,$(filter psa_asymmetric_ecc_p256r1_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_ecc_p256r1
endif
## ECC_ED25519 backend
ifneq (,$(filter psa_asymmetric_ecc_ed25519,$(USEMODULE)))
ifeq (,$(filter psa_asymmetric_ecc_ed25519_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_ecc_ed25519
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_ecc_ed25519,$(FEATURES_USED)))
USEMODULE += psa_asymmetric_ecc_ed25519_backend_periph
else
USEMODULE += psa_asymmetric_ecc_ed25519_backend_c25519
endif
endif
endif
ifneq (,$(filter psa_asymmetric_ecc_ed25519_backend_c25519,$(USEMODULE)))
USEPKG += c25519
USEMODULE += psa_c25519
USEMODULE += psa_c25519_edsign
endif
ifneq (,$(filter psa_asymmetric_ecc_ed25519_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_ecc_ed25519
endif
# Cipher
ifneq (,$(filter psa_cipher,$(USEMODULE)))
USEMODULE += psa_key_management
endif
## AES-128-ECB backend
ifneq (,$(filter psa_cipher_aes_128_ecb,$(USEMODULE)))
USEMODULE += psa_cipher_aes_128_ecb_backend_riot
endif
ifneq (,$(filter psa_cipher_aes_128_ecb_backend_riot,$(USEMODULE)))
USEMODULE += crypto
USEMODULE += cipher_modes
USEMODULE += psa_riot_cipher
USEMODULE += psa_riot_cipher_aes_ecb
endif
## AES-128-CBC
ifneq (,$(filter psa_cipher_aes_128_cbc,$(USEMODULE)))
ifeq (,$(filter psa_cipher_aes_128_cbc_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_cipher_aes_128_cbc
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_cipher_aes_128_cbc,$(FEATURES_USED)))
USEMODULE += psa_cipher_aes_128_cbc_backend_periph
else
USEMODULE += psa_cipher_aes_128_cbc_backend_riot
endif
endif
endif
ifneq (,$(filter psa_cipher_aes_128_cbc_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_cipher_aes_128_cbc
endif
ifneq (,$(filter psa_cipher_aes_128_cbc_backend_riot,$(USEMODULE)))
USEMODULE += crypto
USEMODULE += cipher_modes
USEMODULE += psa_riot_cipher
USEMODULE += psa_riot_cipher_aes_128_cbc
endif
## AES-192-CBC
ifneq (,$(filter psa_cipher_aes_192_cbc,$(USEMODULE)))
USEMODULE += psa_cipher_aes_192_cbc_backend_riot
endif
ifneq (,$(filter psa_cipher_aes_192_cbc_backend_riot,$(USEMODULE)))
USEMODULE += crypto
USEMODULE += cipher_modes
USEMODULE += psa_riot_cipher
USEMODULE += psa_riot_cipher_aes_192_cbc
endif
## ChaCha20
ifneq (,$(filter psa_cipher_chacha20,$(USEMODULE)))
ifeq (,$(filter psa_cipher_chacha20_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_cipher_chacha20
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_cipher_chacha20,$(FEATURES_USED)))
USEMODULE += psa_cipher_chacha20_backend_periph
else
USEMODULE += psa_cipher_chacha20_backend_riot
endif
endif
endif
ifneq (,$(filter psa_cipher_chacha20_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_cipher_chacha20
endif
ifneq (,$(filter psa_cipher_chacha20_backend_riot,$(USEMODULE)))
USEMODULE += crypto
USEMODULE += psa_riot_cipher
USEMODULE += psa_riot_cipher_chacha20
endif
# Hash
## MD5
ifneq (,$(filter psa_hash_md5,$(USEMODULE)))
USEMODULE += psa_hash_md5_backend_riot
endif
ifneq (,$(filter psa_hash_md5_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_md5
endif
## SHA-1
ifneq (,$(filter psa_hash_sha_1,$(USEMODULE)))
ifeq (,$(filter psa_hash_sha_1_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_hash_sha_1
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_hash_sha_1,$(FEATURES_USED)))
USEMODULE += psa_hash_sha_1_backend_periph
else
USEMODULE += psa_hash_sha_1_backend_riot
endif
endif
endif
ifneq (,$(filter psa_hash_sha_1_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_hash_sha_1
endif
ifneq (,$(filter psa_hash_sha_1_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_sha_1
endif
## SHA-224
ifneq (,$(filter psa_hash_sha_224,$(USEMODULE)))
ifeq (,$(filter psa_hash_sha_224_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_hash_sha_224
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_hash_sha_224,$(FEATURES_USED)))
USEMODULE += psa_hash_sha_224_backend_periph
else
USEMODULE += psa_hash_sha_224_backend_riot
endif
endif
endif
ifneq (,$(filter psa_hash_sha_224_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_hash_sha_224
endif
ifneq (,$(filter psa_hash_sha_224_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_sha_224
endif
## SHA-256
ifneq (,$(filter psa_hash_sha_256,$(USEMODULE)))
ifeq (,$(filter psa_hash_sha_256_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_hash_sha_256
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_hash_sha_256,$(FEATURES_USED)))
USEMODULE += psa_hash_sha_256_backend_periph
else
USEMODULE += psa_hash_sha_256_backend_riot
endif
endif
endif
ifneq (,$(filter psa_hash_sha_256_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_hash_sha_256
endif
ifneq (,$(filter psa_hash_sha_256_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_sha_256
endif
## SHA-384
ifneq (,$(filter psa_hash_sha_384,$(USEMODULE)))
ifeq (,$(filter psa_hash_sha_384_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_hash_sha_384
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_hash_sha_384,$(FEATURES_USED)))
USEMODULE += psa_hash_sha_384_backend_periph
else
USEMODULE += psa_hash_sha_384_backend_riot
endif
endif
endif
ifneq (,$(filter psa_hash_sha_384_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_hash_sha_384
endif
ifneq (,$(filter psa_hash_sha_384_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_sha_384
endif
## SHA-512
ifneq (,$(filter psa_hash_sha_512,$(USEMODULE)))
ifeq (,$(filter psa_hash_sha_512_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_hash_sha_512
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_hash_sha_512,$(FEATURES_USED)))
USEMODULE += psa_hash_sha_512_backend_periph
else
USEMODULE += psa_hash_sha_512_backend_riot
endif
endif
endif
ifneq (,$(filter psa_hash_sha_512_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_hash_sha_512
endif
ifneq (,$(filter psa_hash_sha_512_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_sha_512
endif
## SHA-512/224
ifneq (,$(filter psa_hash_sha_512_224,$(USEMODULE)))
ifeq (,$(filter psa_hash_sha_512_224_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_hash_sha_512_224
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_hash_sha_512_224,$(FEATURES_USED)))
USEMODULE += psa_hash_sha_512_224_backend_periph
else
USEMODULE += psa_hash_sha_512_224_backend_riot
endif
endif
endif
ifneq (,$(filter psa_hash_sha_512_224_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_hash_sha_512_224
endif
ifneq (,$(filter psa_hash_sha_512_224_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_sha_512_224
endif
## SHA-512/256
ifneq (,$(filter psa_hash_sha_512_256,$(USEMODULE)))
ifeq (,$(filter psa_hash_sha_512_256_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_hash_sha_512_256
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_hash_sha_512_256,$(FEATURES_USED)))
USEMODULE += psa_hash_sha_512_256_backend_periph
else
USEMODULE += psa_hash_sha_512_256_backend_riot
endif
endif
endif
ifneq (,$(filter psa_hash_sha_512_256_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_hash_sha_512_256
endif
ifneq (,$(filter psa_hash_sha_512_256_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_sha_512_256
endif
## SHA-3/256
ifneq (,$(filter psa_hash_sha3_256,$(USEMODULE)))
ifeq (,$(filter psa_hash_sha3_256_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_hash_sha3_256
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_hash_sha3_256,$(FEATURES_USED)))
USEMODULE += psa_hash_sha3_256_backend_periph
else
USEMODULE += psa_hash_sha3_256_backend_riot
endif
endif
endif
ifneq (,$(filter psa_hash_sha3_256_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_hash_sha3_256
endif
ifneq (,$(filter psa_hash_sha3_256_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_sha3_256
endif
## SHA-3/384
ifneq (,$(filter psa_hash_sha3_384,$(USEMODULE)))
ifeq (,$(filter psa_hash_sha3_384_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_hash_sha3_384
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_hash_sha3_384,$(FEATURES_USED)))
USEMODULE += psa_hash_sha3_384_backend_periph
else
USEMODULE += psa_hash_sha3_384_backend_riot
endif
endif
endif
ifneq (,$(filter psa_hash_sha3_384_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_hash_sha3_384
endif
ifneq (,$(filter psa_hash_sha3_384_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_sha3_384
endif
## SHA-3/512
ifneq (,$(filter psa_hash_sha3_512,$(USEMODULE)))
ifeq (,$(filter psa_hash_sha3_512_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_hash_sha3_512
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_hash_sha3_512,$(FEATURES_USED)))
USEMODULE += psa_hash_sha3_512_backend_periph
else
USEMODULE += psa_hash_sha3_512_backend_riot
endif
endif
endif
ifneq (,$(filter psa_hash_sha3_512_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_hash_sha3_512
endif
ifneq (,$(filter psa_hash_sha3_512_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_sha3_512
endif
# Key Management
ifneq (,$(filter psa_key_management,$(USEMODULE)))
USEMODULE += psa_key_slot_mgmt
endif
# MAC
ifneq (,$(filter psa_mac,$(USEMODULE)))
USEMODULE += psa_key_management
endif
## HMAC SHA-256
ifneq (,$(filter psa_mac_hmac_sha_256,$(USEMODULE)))
ifeq (,$(filter psa_mac_hmac_sha_256_custom_backend,$(USEMODULE)))
FEATURES_OPTIONAL += periph_hmac_sha_256
include $(RIOTMAKE)/features_check.inc.mk
# HACK: Due to kconfig migration, may cause problems
ifneq (,$(filter periph_hmac_sha_256,$(FEATURES_USED)))
USEMODULE += psa_mac_hmac_sha_256_backend_periph
else
USEMODULE += psa_mac_hmac_sha_256_backend_riot
endif
endif
endif
ifneq (,$(filter psa_mac_hmac_sha_256_backend_periph,$(USEMODULE)))
FEATURES_REQUIRED += periph_hmac_sha_256
endif
ifneq (,$(filter psa_mac_hmac_sha_256_backend_riot,$(USEMODULE)))
USEMODULE += hashes
USEMODULE += psa_riot_hashes
USEMODULE += psa_riot_hashes_hmac_sha256
endif
# Secure Elements
ifneq (,$(filter psa_secure_element,$(USEMODULE)))
USEMODULE += psa_se_mgmt
USEMODULE += psa_key_management
endif
ifneq (,$(filter psa_secure_element_ateccx08a, $(USEMODULE)))
USEPKG += cryptoauthlib
USEMODULE += psa_secure_element_config
endif