Added support for AES-ECB to the PSA Crypto implementation
PSA_ALG_ECB_NO_PADDING came in to the PSA Crypto API spec v1.0.0, but
was not implemented yet in the mbed TLS implementation.
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
diff --git a/include/mbedtls/psa_util.h b/include/mbedtls/psa_util.h
index 513bc5f..a8c15a0 100644
--- a/include/mbedtls/psa_util.h
+++ b/include/mbedtls/psa_util.h
@@ -85,6 +85,8 @@
{
switch( mode )
{
+ case MBEDTLS_MODE_ECB:
+ return ( PSA_ALG_ECB_NO_PADDING );
case MBEDTLS_MODE_GCM:
return( PSA_ALG_AEAD_WITH_TAG_LENGTH( PSA_ALG_GCM, taglen ) );
case MBEDTLS_MODE_CCM:
diff --git a/include/psa/crypto_values.h b/include/psa/crypto_values.h
index f33946a..786a3bb 100644
--- a/include/psa/crypto_values.h
+++ b/include/psa/crypto_values.h
@@ -980,6 +980,15 @@
*/
#define PSA_ALG_XTS ((psa_algorithm_t)0x044000ff)
+/** The Electronic Code Book (ECB) mode of a block cipher, with no padding.
+ *
+ * The underlying block cipher is determined by the key type.
+ *
+ * This symmetric cipher mode can only be used with messages whose lengths
+ * are whole number of blocks for the chosen block cipher.
+ */
+#define PSA_ALG_ECB_NO_PADDING ((psa_algorithm_t)0x04404400)
+
/** The CBC block cipher chaining mode, with no padding.
*
* The underlying block cipher is determined by the key type.