From 6e59c42d1d2453919500ba75f2a71a9c3cc1d2f5 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 26 Jun 2019 19:06:52 +0200 Subject: [PATCH] Split the secure element driver method table memory layout Instead of having one giant table containing all possible methods, represent a driver's method table as a structure containing pointers to substructures. This way a driver that doesn't implement a certain class of operations can use NULL for this class as a whole instead of storing NULL for each method. --- include/psa/crypto_se_driver.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/psa/crypto_se_driver.h b/include/psa/crypto_se_driver.h index fc0d96162c..87a9354752 100644 --- a/include/psa/crypto_se_driver.h +++ b/include/psa/crypto_se_driver.h @@ -980,12 +980,12 @@ typedef struct { * Use #PSA_DRV_SE_HAL_VERSION. */ uint32_t hal_version; - psa_drv_se_key_management_t key_management; - psa_drv_se_mac_t mac; - psa_drv_se_cipher_t cipher; - psa_drv_se_aead_t aead; - psa_drv_se_asymmetric_t asymmetric; - psa_drv_se_key_derivation_t derivation; + const psa_drv_se_key_management_t *key_management; + const psa_drv_se_mac_t *mac; + const psa_drv_se_cipher_t *cipher; + const psa_drv_se_aead_t *aead; + const psa_drv_se_asymmetric_t *asymmetric; + const psa_drv_se_key_derivation_t *derivation; } psa_drv_se_t; /** The current version of the secure element driver HAL.