Skip to content

Commit aa0c917

Browse files
LDong-ArmPatater
authored andcommitted
psa: Add PSA_ALG_ECB_NO_PADDING to TF-M v1.0
TF-M v1.0 implements an older version of PSA and does not have the macro `PSA_ALG_ECB_NO_PADDING` required by `mbedtls_psa_translate_cipher_mode()` in Mbed TLS v2.25.0. Copy this macro from Mbed TLS to fix the issue.
1 parent e5230c9 commit aa0c917

File tree

1 file changed

+20
-0
lines changed
  • platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/include/psa

1 file changed

+20
-0
lines changed

platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_V1_0/include/psa/crypto_values.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,26 @@
985985
*/
986986
#define PSA_ALG_CBC_NO_PADDING ((psa_algorithm_t)0x04600100)
987987

988+
/** The Electronic Code Book (ECB) mode of a block cipher, with no padding.
989+
*
990+
* \warning ECB mode does not protect the confidentiality of the encrypted data
991+
* except in extremely narrow circumstances. It is recommended that applications
992+
* only use ECB if they need to construct an operating mode that the
993+
* implementation does not provide. Implementations are encouraged to provide
994+
* the modes that applications need in preference to supporting direct access
995+
* to ECB.
996+
*
997+
* The underlying block cipher is determined by the key type.
998+
*
999+
* This symmetric cipher mode can only be used with messages whose lengths are a
1000+
* multiple of the block size of the chosen block cipher.
1001+
*
1002+
* ECB mode does not accept an initialization vector (IV). When using a
1003+
* multi-part cipher operation with this algorithm, psa_cipher_generate_iv()
1004+
* and psa_cipher_set_iv() must not be called.
1005+
*/
1006+
#define PSA_ALG_ECB_NO_PADDING ((psa_algorithm_t)0x04404400)
1007+
9881008
/** The CBC block cipher chaining mode with PKCS#7 padding.
9891009
*
9901010
* The underlying block cipher is determined by the key type.

0 commit comments

Comments
 (0)