mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
tests: psa: Add mbedtls/MBEDTLS prefix to test driver symbols
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
@ -31,16 +31,17 @@
|
||||
|
||||
typedef struct {
|
||||
unsigned int context;
|
||||
} test_driver_key_context_t;
|
||||
} mbedtls_test_driver_key_context_t;
|
||||
|
||||
/** \def TEST_DRIVER_KEY_CONTEXT_BASE_SIZE
|
||||
/** \def MBEDTLS_TEST_DRIVER_KEY_CONTEXT_BASE_SIZE
|
||||
*
|
||||
* This macro returns the base size for the key context. It is the size of the
|
||||
* driver specific information stored in each key context.
|
||||
*/
|
||||
#define TEST_DRIVER_KEY_CONTEXT_BASE_SIZE sizeof( test_driver_key_context_t )
|
||||
#define MBEDTLS_TEST_DRIVER_KEY_CONTEXT_BASE_SIZE \
|
||||
sizeof( mbedtls_test_driver_key_context_t )
|
||||
|
||||
/** \def TEST_DRIVER_KEY_CONTEXT_KEY_PAIR_SIZE
|
||||
/** \def MBEDTLS_TEST_DRIVER_KEY_CONTEXT_KEY_PAIR_SIZE
|
||||
*
|
||||
* Number of bytes included in every key context for a key pair.
|
||||
*
|
||||
@ -49,47 +50,47 @@ typedef struct {
|
||||
* subtracting the public key size below from this one.
|
||||
*/
|
||||
|
||||
#define TEST_DRIVER_KEY_CONTEXT_KEY_PAIR_SIZE 65
|
||||
#define MBEDTLS_TEST_DRIVER_KEY_CONTEXT_KEY_PAIR_SIZE 65
|
||||
|
||||
/** \def TEST_DRIVER_KEY_CONTEXT_PUBLIC_KEY_SIZE
|
||||
/** \def MBEDTLS_TEST_DRIVER_KEY_CONTEXT_PUBLIC_KEY_SIZE
|
||||
*
|
||||
* Number of bytes included in every key context for a public key.
|
||||
*
|
||||
* For ECC public keys, it needs 257 bits so 33 bytes.
|
||||
*/
|
||||
#define TEST_DRIVER_KEY_CONTEXT_PUBLIC_KEY_SIZE 33
|
||||
#define MBEDTLS_TEST_DRIVER_KEY_CONTEXT_PUBLIC_KEY_SIZE 33
|
||||
|
||||
/** \def TEST_DRIVER_KEY_CONTEXT_SYMMETRIC_FACTOR
|
||||
/** \def MBEDTLS_TEST_DRIVER_KEY_CONTEXT_SYMMETRIC_FACTOR
|
||||
*
|
||||
* Every key context for a symmetric key includes this many times the key size.
|
||||
*/
|
||||
#define TEST_DRIVER_KEY_CONTEXT_SYMMETRIC_FACTOR 0
|
||||
#define MBEDTLS_TEST_DRIVER_KEY_CONTEXT_SYMMETRIC_FACTOR 0
|
||||
|
||||
/** \def TEST_DRIVER_KEY_CONTEXT_STORE_PUBLIC_KEY
|
||||
/** \def MBEDTLS_TEST_DRIVER_KEY_CONTEXT_STORE_PUBLIC_KEY
|
||||
*
|
||||
* If this is true for a key pair, the key context includes space for the public key.
|
||||
* If this is false, no additional space is added for the public key.
|
||||
*
|
||||
* For this instance, store the public key with the private one.
|
||||
*/
|
||||
#define TEST_DRIVER_KEY_CONTEXT_STORE_PUBLIC_KEY 1
|
||||
#define MBEDTLS_TEST_DRIVER_KEY_CONTEXT_STORE_PUBLIC_KEY 1
|
||||
|
||||
/** \def TEST_DRIVER_KEY_CONTEXT_SIZE_FUNCTION
|
||||
/** \def MBEDTLS_TEST_DRIVER_KEY_CONTEXT_SIZE_FUNCTION
|
||||
*
|
||||
* If TEST_DRIVER_KEY_CONTEXT_SIZE_FUNCTION is defined, the test driver
|
||||
* If MBEDTLS_TEST_DRIVER_KEY_CONTEXT_SIZE_FUNCTION is defined, the test driver
|
||||
* provides a size_function entry point, otherwise, it does not.
|
||||
*
|
||||
* Some opaque drivers have the need to support a custom size for the storage
|
||||
* of key and context information. The size_function provides the ability to
|
||||
* provide that customization.
|
||||
*/
|
||||
//#define TEST_DRIVER_KEY_CONTEXT_SIZE_FUNCTION
|
||||
//#define MBEDTLS_TEST_DRIVER_KEY_CONTEXT_SIZE_FUNCTION
|
||||
|
||||
#ifdef TEST_DRIVER_KEY_CONTEXT_SIZE_FUNCTION
|
||||
size_t test_size_function(
|
||||
#ifdef MBEDTLS_TEST_DRIVER_KEY_CONTEXT_SIZE_FUNCTION
|
||||
size_t mbedtls_test_size_function(
|
||||
const psa_key_type_t key_type,
|
||||
const size_t key_bits );
|
||||
#endif /* TEST_DRIVER_KEY_CONTEXT_SIZE_FUNCTION */
|
||||
#endif /* MBEDTLS_TEST_DRIVER_KEY_CONTEXT_SIZE_FUNCTION */
|
||||
|
||||
#endif /* PSA_CRYPTO_DRIVER_TEST */
|
||||
#endif /* PSA_CRYPTO_TEST_DRIVERS_SIZE_H */
|
||||
|
Reference in New Issue
Block a user