Add PSA config support for ChaCha20+Poly1305

Add checks for PSA_WANT_ALG_CHACHA20_POLY1305.

Signed-off-by: David Brown <david.brown@linaro.org>
This commit is contained in:
David Brown 2021-02-08 16:47:35 -07:00
parent b16727a603
commit ac4fa07fa3

View file

@ -360,6 +360,14 @@ extern "C" {
#endif
#endif /* PSA_WANT_ALG_CBC_PKCS7 */
#if defined(PSA_WANT_ALG_CHACHA20_POLY1305)
#if defined(PSA_WANT_KEY_TYPE_CHACHA20)
#define MBEDTLS_CHACHAPOLY_C
#else /* not PSA_WANT_KEY_TYPE_CHACHA20 */
#error "PSA_WANT_ALG_CHACHA20_POLY1305 requires PSA_WANT_KEY_TYPE_CHACHA20"
#endif /* PSA_WANT_KEY_TYPE_CHACHA20 */
#endif /* PSA_WANT_ALG_CHACHA20_POLY1305 */
#else /* MBEDTLS_PSA_CRYPTO_CONFIG */
/*
@ -495,6 +503,9 @@ extern "C" {
#define PSA_WANT_ALG_STREAM_CIPHER 1
#define MBEDTLS_PSA_BUILTIN_KEY_TYPE_CHACHA20 1
#define MBEDTLS_PSA_BUILTIN_ALG_STREAM_CIPHER 1
#if defined(MBEDTLS_CHACHAPOLY_C)
#define PSA_WANT_ALG_CHACHA20_POLY1305 1
#endif
#endif
#if defined(MBEDTLS_CIPHER_MODE_CBC)