Add definitions for builtins for cipher modes

Create these definitions for the various cipher modes.

Signed-off-by: David Brown <david.brown@linaro.org>
This commit is contained in:
David Brown 2021-01-26 11:50:36 -07:00
parent da7dbb72ed
commit 12f45f99da

View File

@ -249,27 +249,31 @@ extern "C" {
#endif /* PSA_WANT_KEY_TYPE_DES */ #endif /* PSA_WANT_KEY_TYPE_DES */
#if defined(PSA_WANT_ALG_STREAM_CIPHER) #if defined(PSA_WANT_ALG_STREAM_CIPHER)
/* Nothing to define */ #define MBEDTLS_PSA_BUILTIN_ALG_STREAM_CIPHER 1
#endif /* PSA_WANT_ALG_STREAM_CIPHER */ #endif /* PSA_WANT_ALG_STREAM_CIPHER */
#if defined(PSA_WANT_ALG_CTR) #if defined(PSA_WANT_ALG_CTR)
#define MBEDTLS_PSA_BUILTIN_ALG_CTR 1
#define MBEDTLS_CIPHER_MODE_CTR #define MBEDTLS_CIPHER_MODE_CTR
#endif /* PSA_WANT_ALG_CTR */ #endif /* PSA_WANT_ALG_CTR */
#if defined(PSA_WANT_ALG_CFB) #if defined(PSA_WANT_ALG_CFB)
#define MBEDTLS_PSA_BUILTIN_ALG_CFB 1
#define MBEDTLS_CIPHER_MODE_CFB #define MBEDTLS_CIPHER_MODE_CFB
#endif /* PSA_WANT_ALG_CFB */ #endif /* PSA_WANT_ALG_CFB */
#if defined(PSA_WANT_ALG_OFB) #if defined(PSA_WANT_ALG_OFB)
#define MBEDTLS_PSA_BUILTIN_ALG_OFB 1
#define MBEDTLS_CIPHER_MODE_OFB #define MBEDTLS_CIPHER_MODE_OFB
#endif /* PSA_WANT_ALG_OFB */ #endif /* PSA_WANT_ALG_OFB */
#if defined(PSA_WANT_ALG_XTS) #if defined(PSA_WANT_ALG_XTS)
#define MBEDTLS_PSA_BUILTIN_ALG_XTS 1
#define MBEDTLS_CIPHER_MODE_XTS #define MBEDTLS_CIPHER_MODE_XTS
#endif /* PSA_WANT_ALG_XTS */ #endif /* PSA_WANT_ALG_XTS */
#if defined(PSA_WANT_ALG_ECB_NO_PADDING) #if defined(PSA_WANT_ALG_ECB_NO_PADDING)
/* Nothing to define. */ #define MBEDTLS_PSA_BUILTIN_ALG_ECB 1
#endif #endif
#if defined(PSA_WANT_ALG_CBC_NO_PADDING) || defined(PSA_WANT_ALG_CBC_PKCS7) #if defined(PSA_WANT_ALG_CBC_NO_PADDING) || defined(PSA_WANT_ALG_CBC_PKCS7)
@ -279,6 +283,14 @@ extern "C" {
#endif /* PSA_WANT_ALG_CBC_PKCS7 */ #endif /* PSA_WANT_ALG_CBC_PKCS7 */
#endif /* PSA_WANT_ALG_CBC_NO_PADDING || PSA_WANT_ALG_CBC_PKCS7 */ #endif /* PSA_WANT_ALG_CBC_NO_PADDING || PSA_WANT_ALG_CBC_PKCS7 */
#if defined(PSA_WANT_ALG_CBC_NO_PADDING)
#define MBEDTLS_PSA_BUILTIN_ALG_CBC_NO_PADDING 1
#endif /* PSA_WANT_ALG_CBC_NO_PADDING */
#if defined(PSA_WANT_ALG_CBC_PKCS7)
#define MBEDTLS_PSA_BUILTIN_ALG_CBC_PKCS7 1
#endif /* PSA_WANT_ALG_CBC_PKCS7 */
#else /* MBEDTLS_PSA_CRYPTO_CONFIG */ #else /* MBEDTLS_PSA_CRYPTO_CONFIG */
/* /*
@ -396,6 +408,7 @@ extern "C" {
#define PSA_WANT_KEY_TYPE_ARC4 1 #define PSA_WANT_KEY_TYPE_ARC4 1
#define PSA_WANT_ALG_STREAM_CIPHER 1 #define PSA_WANT_ALG_STREAM_CIPHER 1
#define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ARC4 1 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ARC4 1
#define MBEDTLS_PSA_BUILTIN_ALG_STREAM_CIPHER 1
#endif #endif
#if defined(MBEDTLS_CAMELLIA_C) #if defined(MBEDTLS_CAMELLIA_C)
@ -411,28 +424,34 @@ extern "C" {
#if defined(MBEDTLS_CIPHER_MODE_CBC) #if defined(MBEDTLS_CIPHER_MODE_CBC)
#define PSA_WANT_ALG_CBC_NO_PADDING 1 #define PSA_WANT_ALG_CBC_NO_PADDING 1
#if defined(MBEDTLS_CIPHER_PADDING_PKCS7) #if defined(MBEDTLS_CIPHER_PADDING_PKCS7)
#define MBEDTLS_PSA_BUILTIN_ALG_CBC_PKCS7 1
#define PSA_WANT_ALG_CBC_PKCS7 1 #define PSA_WANT_ALG_CBC_PKCS7 1
#endif #endif
#endif #endif
#if defined(MBEDTLS_AES_C) || defined(MBEDTLS_DES_C) || \ #if defined(MBEDTLS_AES_C) || defined(MBEDTLS_DES_C) || \
defined(MBEDTLS_CAMELLIA_C) defined(MBEDTLS_CAMELLIA_C)
#define MBEDTLS_PSA_BUILTIN_ALG_ECB 1
#define PSA_WANT_ALG_ECB_NO_PADDING 1 #define PSA_WANT_ALG_ECB_NO_PADDING 1
#endif #endif
#if defined(MBEDTLS_CIPHER_MODE_CFB) #if defined(MBEDTLS_CIPHER_MODE_CFB)
#define MBEDTLS_PSA_BUILTIN_ALG_CFB 1
#define PSA_WANT_ALG_CFB 1 #define PSA_WANT_ALG_CFB 1
#endif #endif
#if defined(MBEDTLS_CIPHER_MODE_CTR) #if defined(MBEDTLS_CIPHER_MODE_CTR)
#define MBEDTLS_PSA_BUILTIN_ALG_CTR 1
#define PSA_WANT_ALG_CTR 1 #define PSA_WANT_ALG_CTR 1
#endif #endif
#if defined(MBEDTLS_CIPHER_MODE_OFB) #if defined(MBEDTLS_CIPHER_MODE_OFB)
#define MBEDTLS_PSA_BUILTIN_ALG_OFB 1
#define PSA_WANT_ALG_OFB 1 #define PSA_WANT_ALG_OFB 1
#endif #endif
#if defined(MBEDTLS_CIPHER_MODE_XTS) #if defined(MBEDTLS_CIPHER_MODE_XTS)
#define MBEDTLS_PSA_BUILTIN_ALG_XTS 1
#define PSA_WANT_ALG_XTS 1 #define PSA_WANT_ALG_XTS 1
#endif #endif