1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

tests: Add AEAD transparent test driver hooks

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron
2021-03-23 09:33:25 +01:00
parent de82281541
commit bfe551d15e
2 changed files with 51 additions and 4 deletions

View File

@ -29,6 +29,25 @@
#if defined(PSA_CRYPTO_DRIVER_TEST)
#include <psa/crypto_driver_common.h>
typedef struct {
/* If not PSA_SUCCESS, return this error code instead of processing the
* function call. */
psa_status_t forced_status;
/* Count the amount of times AEAD driver functions are called. */
unsigned long hits;
/* Status returned by the last AEAD driver function call. */
psa_status_t driver_status;
} test_driver_aead_hooks_t;
#define TEST_DRIVER_AEAD_INIT { 0, 0, 0 }
static inline test_driver_aead_hooks_t test_driver_aead_hooks_init( void )
{
const test_driver_aead_hooks_t v = TEST_DRIVER_AEAD_INIT;
return( v );
}
extern test_driver_aead_hooks_t test_driver_aead_hooks;
psa_status_t test_transparent_aead_encrypt(
const psa_key_attributes_t *attributes,
const uint8_t *key_buffer, size_t key_buffer_size,