CC3XX: Make the restartable APIs non-optional at build time
Simplify the build time configuration by making restartable API
enablement not optional at build time. If the upper layer won't
require restartability, they won't need to call the restartable
APIs that will get pruned at link time anyway.
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
Change-Id: I24bee72cd7dbcbf2bccf205e8a8b9a851af3231c
diff --git a/platform/ext/accelerator/cc312/cc312-rom/cc3xx_aes.c b/platform/ext/accelerator/cc312/cc312-rom/cc3xx_aes.c
index 13b691a..e43bd0e 100644
--- a/platform/ext/accelerator/cc312/cc312-rom/cc3xx_aes.c
+++ b/platform/ext/accelerator/cc312/cc312-rom/cc3xx_aes.c
@@ -488,7 +488,6 @@
return CC3XX_ERR_SUCCESS;
}
-#ifdef CC3XX_CONFIG_AES_RESTARTABLE_ENABLE
void cc3xx_aes_get_state(struct cc3xx_aes_state_t *state)
{
#ifdef CC3XX_CONFIG_DPA_MITIGATIONS_ENABLE
@@ -565,7 +564,6 @@
return CC3XX_ERR_SUCCESS;
}
-#endif /* CC3XX_CONFIG_AES_RESTARTABLE_ENABLE */
void cc3xx_aes_set_output_buffer(uint8_t *out, size_t out_len)
{
diff --git a/platform/ext/accelerator/cc312/cc312-rom/cc3xx_chacha.c b/platform/ext/accelerator/cc312/cc312-rom/cc3xx_chacha.c
index b5a1add..3483c98 100644
--- a/platform/ext/accelerator/cc312/cc312-rom/cc3xx_chacha.c
+++ b/platform/ext/accelerator/cc312/cc312-rom/cc3xx_chacha.c
@@ -157,7 +157,6 @@
return CC3XX_ERR_SUCCESS;
}
-#ifdef CC3XX_CONFIG_CHACHA_RESTARTABLE_ENABLE
void cc3xx_chacha20_get_state(struct cc3xx_chacha_state_t *state)
{
memcpy(state, &chacha_state, sizeof(struct cc3xx_chacha_state_t));
@@ -190,7 +189,6 @@
*/
P_CC3XX->chacha.chacha_control_reg |= 0b1 << 1;
}
-#endif /* CC3XX_CONFIG_CHACHA_RESTARTABLE_ENABLE */
void cc3xx_chacha20_set_output_buffer(uint8_t *out, size_t out_len)
{
diff --git a/platform/ext/accelerator/cc312/cc312-rom/cc3xx_hash.c b/platform/ext/accelerator/cc312/cc312-rom/cc3xx_hash.c
index a4137b3..c0ae4e6 100644
--- a/platform/ext/accelerator/cc312/cc312-rom/cc3xx_hash.c
+++ b/platform/ext/accelerator/cc312/cc312-rom/cc3xx_hash.c
@@ -139,7 +139,6 @@
return cc3xx_dma_buffered_input_data(buf, length, false);
}
-#ifdef CC3XX_CONFIG_HASH_RESTARTABLE_ENABLE
void cc3xx_hash_get_state(struct cc3xx_hash_state_t *state)
{
state->curr_len = P_CC3XX->hash.hash_cur_len[0];
@@ -162,7 +161,6 @@
set_hash_h(state->hash_h, hash_h_len);
memcpy(&dma_state, &state->dma_state, sizeof(dma_state));
}
-#endif /* CC3XX_CONFIG_HASH_RESTARTABLE_ENABLE */
void cc3xx_hash_finish(uint32_t *res, size_t length)
{
diff --git a/platform/ext/target/arm/corstone1000/cc3xx_config.h b/platform/ext/target/arm/corstone1000/cc3xx_config.h
index 48e0677..7db5488 100644
--- a/platform/ext/target/arm/corstone1000/cc3xx_config.h
+++ b/platform/ext/target/arm/corstone1000/cc3xx_config.h
@@ -22,9 +22,6 @@
/* Whether the SHA1 hash support is enabled */
/* #define CC3XX_CONFIG_HASH_SHA1_ENABLE */
-/* Whether hashing can be restartable */
-/* #define CC3XX_CONFIG_HASH_RESTARTABLE_ENABLE */
-
/* Whether the AES CTR support is enabled */
#define CC3XX_CONFIG_AES_CTR_ENABLE
@@ -44,10 +41,6 @@
/* Whether the AES CCM support is enabled */
/* #define CC3XX_CONFIG_AES_CCM_ENABLE */
-
-/* Whether AES can be restartable */
-/* #define CC3XX_CONFIG_AES_RESTARTABLE_ENABLE */
-
/* Whether the AES tunnelling support is enabled. Without this, running CCM mode
* AES will instead only run the CBC_MAC operation with the CCM IVs, with the
* CTR decryption having to be done seperately. */
@@ -56,9 +49,6 @@
/* Whether CHACHA is enabled */
/* #define CC3XX_CONFIG_CHACHA_ENABLE */
-/* Whether CHACHA can be restartable */
-/* #define CC3XX_CONFIG_CHACHA_RESTARTABLE_ENABLE */
-
/* Whether CHACHA_POLY1305 is enabled */
/* #define CC3XX_CONFIG_CHACHA_POLY1305_ENABLE */
diff --git a/platform/ext/target/arm/rss/common/cc312/cc3xx_config.h b/platform/ext/target/arm/rss/common/cc312/cc3xx_config.h
index f4e856d..9e1f038 100644
--- a/platform/ext/target/arm/rss/common/cc312/cc3xx_config.h
+++ b/platform/ext/target/arm/rss/common/cc312/cc3xx_config.h
@@ -22,9 +22,6 @@
/* Whether the SHA1 hash support is enabled */
/* #define CC3XX_CONFIG_HASH_SHA1_ENABLE */
-/* Whether hashing can be restartable */
-/* #define CC3XX_CONFIG_HASH_RESTARTABLE_ENABLE */
-
/* Whether the AES CTR support is enabled */
#define CC3XX_CONFIG_AES_CTR_ENABLE
@@ -44,9 +41,6 @@
/* Whether the AES CCM support is enabled */
#define CC3XX_CONFIG_AES_CCM_ENABLE
-/* Whether AES can be restartable */
-/* #define CC3XX_CONFIG_AES_RESTARTABLE_ENABLE */
-
/* Whether the AES tunnelling support is enabled. Without this, running CCM mode
* AES will instead only run the CBC_MAC operation with the CCM IVs, with the
* CTR decryption having to be done seperately. */
@@ -60,9 +54,6 @@
/* Whether CHACHA is enabled */
/* #define CC3XX_CONFIG_CHACHA_ENABLE */
-/* Whether CHACHA can be restartable */
-/* #define CC3XX_CONFIG_CHACHA_RESTARTABLE_ENABLE */
-
/* Whether CHACHA_POLY1305 is enabled */
/* #define CC3XX_CONFIG_CHACHA_POLY1305_ENABLE */