mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
289 lines
8.4 KiB
Makefile
289 lines
8.4 KiB
Makefile
ifneq (,$(filter psa_crypto,$(USEMODULE)))
|
|
USEMODULE += random
|
|
USEMODULE += prng_musl_lcg
|
|
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
|
|
|
|
# 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-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
|
|
# 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
|