# include the PSA headers INCLUDES += -I$(RIOTBASE)/sys/psa_crypto/include # Workaround for mbedtls namespacing issue # sys/include will include the conflicting header files in psa but requires a psa/*.h structure. INCLUDES += -I$(RIOTBASE)/sys/include/psa_crypto backends = $(words $(filter $1_backend_%,$(USEMODULE))) # Pseudomodules ## Asymmetric PSEUDOMODULES += psa_asymmetric PSEUDOMODULES += psa_asymmetric_ecc_p192r1 PSEUDOMODULES += psa_asymmetric_ecc_p192r1_backend_microecc PSEUDOMODULES += psa_asymmetric_ecc_p192r1_backend_periph PSEUDOMODULES += psa_asymmetric_ecc_p192r1_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_asymmetric_ecc_p192r1,$(USEMODULE))) ifneq (1,$(call backends, psa_asymmetric_ecc_p192r1)) $(error "One (and only one) backend should be selected for psa_asymmetric_ecc_p192r1") endif endif PSEUDOMODULES += psa_asymmetric_ecc_p256r1 PSEUDOMODULES += psa_asymmetric_ecc_p256r1_backend_microecc PSEUDOMODULES += psa_asymmetric_ecc_p256r1_backend_periph PSEUDOMODULES += psa_asymmetric_ecc_p256r1_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_asymmetric_ecc_p256r1,$(USEMODULE))) ifneq (1,$(call backends, psa_asymmetric_ecc_p256r1)) $(error "One (and only one) backend should be selected for psa_asymmetric_ecc_p256r1") endif endif PSEUDOMODULES += psa_asymmetric_ecc_ed25519 PSEUDOMODULES += psa_asymmetric_ecc_ed25519_backend_periph PSEUDOMODULES += psa_asymmetric_ecc_ed25519_backend_c25519 PSEUDOMODULES += psa_asymmetric_ecc_ed25519_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_asymmetric_ecc_ed25519,$(USEMODULE))) ifneq (1,$(call backends, psa_asymmetric_ecc_ed25519)) $(error "One (and only one) backend should be selected for psa_asymmetric_ecc_ed25519") endif endif ## Cipher PSEUDOMODULES += psa_cipher PSEUDOMODULES += psa_cipher_aes_128_ecb PSEUDOMODULES += psa_cipher_aes_128_ecb_backend_riot PSEUDOMODULES += psa_cipher_aes_128_cbc PSEUDOMODULES += psa_cipher_aes_128_cbc_backend_periph PSEUDOMODULES += psa_cipher_aes_128_cbc_backend_riot PSEUDOMODULES += psa_cipher_aes_128_cbc_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_cipher_aes_128_cbc,$(USEMODULE))) ifneq (1,$(call backends,psa_cipher_aes_128_cbc)) $(error "One (and only one) backend should be selected for psa_cipher_aes_128_cbc") endif endif PSEUDOMODULES += psa_cipher_aes_192_cbc PSEUDOMODULES += psa_cipher_aes_192_cbc_backend_riot PSEUDOMODULES += psa_cipher_aes_192_cbc_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_cipher_aes_192_cbc,$(USEMODULE))) ifneq (1,$(call backends,psa_cipher_aes_192_cbc)) $(error "One (and only one) backend should be selected for psa_cipher_aes_192_cbc") endif endif PSEUDOMODULES += psa_cipher_aes_256_cbc PSEUDOMODULES += psa_cipher_aes_256_cbc_backend_riot PSEUDOMODULES += psa_cipher_aes_256_cbc_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_cipher_aes_256_cbc,$(USEMODULE))) ifneq (1,$(call backends,psa_cipher_aes_256_cbc)) $(error "One (and only one) backend should be selected for psa_cipher_aes_256_cbc") endif endif PSEUDOMODULES += psa_cipher_chacha20 PSEUDOMODULES += psa_cipher_chacha20_backend_periph PSEUDOMODULES += psa_cipher_chacha20_backend_riot PSEUDOMODULES += psa_cipher_chacha20_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_cipher_chacha20,$(USEMODULE))) ifneq (1,$(call backends,psa_cipher_chacha20)) $(error "One (and only one) backend should be selected for psa_cipher_chacha20") endif endif ## Hash PSEUDOMODULES += psa_hash PSEUDOMODULES += psa_hash_md5 PSEUDOMODULES += psa_hash_md5_backend_riot PSEUDOMODULES += psa_hash_md5_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_hash_md5,$(USEMODULE))) ifneq (1,$(call backends,psa_hash_md5)) $(error "One (and only one) backend should be selected for psa_hash_md5") endif endif PSEUDOMODULES += psa_hash_sha_1 PSEUDOMODULES += psa_hash_sha_1_backend_periph PSEUDOMODULES += psa_hash_sha_1_backend_riot PSEUDOMODULES += psa_hash_sha_1_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_hash_sha_1,$(USEMODULE))) ifneq (1,$(call backends,psa_hash_sha_1)) $(error "One (and only one) backend should be selected for psa_hash_sha_1") endif endif PSEUDOMODULES += psa_hash_sha_224 PSEUDOMODULES += psa_hash_sha_224_backend_periph PSEUDOMODULES += psa_hash_sha_224_backend_riot PSEUDOMODULES += psa_hash_sha_224_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_hash_sha_224,$(USEMODULE))) ifneq (1,$(call backends,psa_hash_sha_224)) $(error "One (and only one) backend should be selected for psa_hash_sha_224") endif endif PSEUDOMODULES += psa_hash_sha_256 PSEUDOMODULES += psa_hash_sha_256_backend_periph PSEUDOMODULES += psa_hash_sha_256_backend_riot PSEUDOMODULES += psa_hash_sha_256_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_hash_sha_256,$(USEMODULE))) ifneq (1,$(call backends,psa_hash_sha_256)) $(error "One (and only one) backend should be selected for psa_hash_sha_256") endif endif PSEUDOMODULES += psa_hash_sha_384 PSEUDOMODULES += psa_hash_sha_384_backend_periph PSEUDOMODULES += psa_hash_sha_384_backend_riot PSEUDOMODULES += psa_hash_sha_384_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_hash_sha_384,$(USEMODULE))) ifneq (1,$(call backends,psa_hash_sha_384)) $(error "One (and only one) backend should be selected for psa_hash_sha_384") endif endif PSEUDOMODULES += psa_hash_sha_512 PSEUDOMODULES += psa_hash_sha_512_backend_periph PSEUDOMODULES += psa_hash_sha_512_backend_riot PSEUDOMODULES += psa_hash_sha_512_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_hash_sha_512,$(USEMODULE))) ifneq (1,$(call backends,psa_hash_sha_512)) $(error "One (and only one) backend should be selected for psa_hash_sha_512") endif endif PSEUDOMODULES += psa_hash_sha3_256 PSEUDOMODULES += psa_hash_sha3_256_backend_periph PSEUDOMODULES += psa_hash_sha3_256_backend_riot PSEUDOMODULES += psa_hash_sha3_256_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_hash_sha3_256,$(USEMODULE))) ifneq (1,$(call backends,psa_hash_sha3_256)) $(error "One (and only one) backend should be selected for psa_hash_sha3_256") endif endif PSEUDOMODULES += psa_hash_sha3_384 PSEUDOMODULES += psa_hash_sha3_384_backend_periph PSEUDOMODULES += psa_hash_sha3_384_backend_riot PSEUDOMODULES += psa_hash_sha3_384_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_hash_sha3_384,$(USEMODULE))) ifneq (1,$(call backends,psa_hash_sha3_384)) $(error "One (and only one) backend should be selected for psa_hash_sha3_384") endif endif PSEUDOMODULES += psa_hash_sha3_512 PSEUDOMODULES += psa_hash_sha3_512_backend_periph PSEUDOMODULES += psa_hash_sha3_512_backend_riot PSEUDOMODULES += psa_hash_sha3_512_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_hash_sha3_512,$(USEMODULE))) ifneq (1,$(call backends,psa_hash_sha3_512)) $(error "One (and only one) backend should be selected for psa_hash_sha3_512") endif endif PSEUDOMODULES += psa_hash_sha_512_224 PSEUDOMODULES += psa_hash_sha_512_224_backend_periph PSEUDOMODULES += psa_hash_sha_512_224_backend_riot PSEUDOMODULES += psa_hash_sha_512_224_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_hash_sha_512_224,$(USEMODULE))) ifneq (1,$(call backends,psa_hash_sha_512_224)) $(error "One (and only one) backend should be selected for psa_hash_sha_512_224") endif endif PSEUDOMODULES += psa_hash_sha_512_256 PSEUDOMODULES += psa_hash_sha_512_256_backend_periph PSEUDOMODULES += psa_hash_sha_512_256_backend_riot PSEUDOMODULES += psa_hash_sha_512_256_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_hash_sha_512_256,$(USEMODULE))) ifneq (1,$(call backends,psa_hash_sha_512_256)) $(error "One (and only one) backend should be selected for psa_hash_sha_512_256") endif endif ## Key Management PSEUDOMODULES += psa_key_management ## MAC PSEUDOMODULES += psa_mac PSEUDOMODULES += psa_mac_hmac_sha_256 PSEUDOMODULES += psa_mac_hmac_sha_256_backend_periph PSEUDOMODULES += psa_mac_hmac_sha_256_backend_riot PSEUDOMODULES += psa_mac_hmac_sha_256_custom_backend # check that one and only one backend has been selected ifneq (,$(filter psa_mac_hmac_sha_256,$(USEMODULE))) ifneq (1,$(call backends,psa_mac_hmac_sha_256)) $(error "One (and only one) backend should be selected for psa_mac_hmac_sha_256") endif endif ## Secure Elements PSEUDOMODULES += psa_secure_element PSEUDOMODULES += psa_secure_element_config PSEUDOMODULES += psa_secure_element_multiple