Add psa_enabled field to cipher ctx and add dummy implementations

This field determines whether a cipher context should
use an external implementation of the PSA Crypto API for
cryptographic operations, or Mbed TLS' own crypto library.

The commit also adds dummy implementations for the cipher API.
This commit is contained in:
Hanno Becker 2018-11-09 16:20:29 +00:00
parent 098c9de2af
commit 1cb36530be
2 changed files with 146 additions and 1 deletions

View file

@ -321,6 +321,18 @@ typedef struct mbedtls_cipher_context_t
/** CMAC-specific context. */
mbedtls_cmac_context_t *cmac_ctx;
#endif
#if defined(MBEDTLS_USE_PSA_CRYPTO)
/** Indicates whether the cipher operations should be performed
* by Mbed TLS' own crypto library or an external implementation
* of the PSA Crypto API.
* This is unset if the cipher context is setup through
* mbedtls_cipher_setup(), and set if it is setup through
* mbedtls_cipher_setup_psa().
*/
unsigned char psa_enabled;
#endif /* MBEDTLS_USE_PSA_CRYPTO */
} mbedtls_cipher_context_t;
/**