![]() |
TF-M Reference Manual
1.2.0
TrustedFirmware-M
|
Go to the source code of this file.
Macros | |
#define | BIT_SIZE_TEST_KEY (128) |
Size of the key to use in tests in bits. More... | |
#define | BIT_SIZE_TEST_LONG_KEY (256) |
Size of the long key to use in tests in bits. More... | |
#define | BYTE_SIZE_TEST_KEY (BIT_SIZE_TEST_KEY/8) |
Macro to extract the size of the key in bytes. More... | |
#define | BYTE_SIZE_CHUNK (16) |
Size in bytes of a chunk of data to process. More... | |
#define | ENC_DEC_BUFFER_SIZE (32) |
Size in bytes of the encryption/decryption buffers. More... | |
#define | ASSOCIATED_DATA_SIZE (24) |
Size in bytes of the associated data to authenticate in AEAD tests. More... | |
#define | TEST_MAX_KEY_LENGTH (64) |
The maximum allowed key length in bytes used in the tests. More... | |
#define | TRUNCATED_AUTH_TAG_LEN (8) |
The length of truncated authentication tag for AEAD algorithm. More... | |
Functions | |
void | psa_key_interface_test (const psa_key_type_t key_type, struct test_result_t *ret) |
Tests the key interfaces with different key types. More... | |
void | psa_cipher_test (const psa_key_type_t key_type, const psa_algorithm_t alg, struct test_result_t *ret) |
Run block ciphering tests with different algorithms and key types. More... | |
void | psa_invalid_cipher_test (const psa_key_type_t key_type, const psa_algorithm_t alg, const size_t key_size, struct test_result_t *ret) |
Tests invalid key type and algorithm combinations for block ciphers. More... | |
void | psa_unsupported_hash_test (const psa_algorithm_t alg, struct test_result_t *ret) |
Tests setup of an unsupported hash algorithm. More... | |
void | psa_hash_test (const psa_algorithm_t alg, struct test_result_t *ret) |
Tests different hashing algorithms. More... | |
void | psa_unsupported_mac_test (const psa_key_type_t key_type, const psa_algorithm_t alg, struct test_result_t *ret) |
Tests setup of an unsupported MAC algorithm. More... | |
void | psa_mac_test (const psa_algorithm_t alg, uint8_t use_long_key, struct test_result_t *ret) |
Tests different MAC algorithms. More... | |
void | psa_aead_test (const psa_key_type_t key_type, const psa_algorithm_t alg, struct test_result_t *ret) |
Run AEAD tests with different algorithms and key types. More... | |
void | psa_invalid_key_length_test (struct test_result_t *ret) |
Tests invalid key length. More... | |
void | psa_policy_key_interface_test (struct test_result_t *ret) |
Tests the policy key interface. More... | |
void | psa_policy_invalid_policy_usage_test (struct test_result_t *ret) |
Tests invalid policy usage. More... | |
void | psa_persistent_key_test (psa_key_id_t key_id, struct test_result_t *ret) |
Tests persistent keys. More... | |
void | psa_key_derivation_test (psa_algorithm_t deriv_alg, struct test_result_t *ret) |
Key derivation test. More... | |
#define ASSOCIATED_DATA_SIZE (24) |
Size in bytes of the associated data to authenticate in AEAD tests.
Definition at line 53 of file crypto_tests_common.h.
#define BIT_SIZE_TEST_KEY (128) |
Size of the key to use in tests in bits.
Definition at line 22 of file crypto_tests_common.h.
#define BIT_SIZE_TEST_LONG_KEY (256) |
Size of the long key to use in tests in bits.
Definition at line 28 of file crypto_tests_common.h.
#define BYTE_SIZE_CHUNK (16) |
Size in bytes of a chunk of data to process.
Definition at line 40 of file crypto_tests_common.h.
#define BYTE_SIZE_TEST_KEY (BIT_SIZE_TEST_KEY/8) |
Macro to extract the size of the key in bytes.
Definition at line 34 of file crypto_tests_common.h.
#define ENC_DEC_BUFFER_SIZE (32) |
Size in bytes of the encryption/decryption buffers.
Definition at line 46 of file crypto_tests_common.h.
#define TEST_MAX_KEY_LENGTH (64) |
The maximum allowed key length in bytes used in the tests.
Definition at line 59 of file crypto_tests_common.h.
#define TRUNCATED_AUTH_TAG_LEN (8) |
The length of truncated authentication tag for AEAD algorithm.
Definition at line 64 of file crypto_tests_common.h.
void psa_aead_test | ( | const psa_key_type_t | key_type, |
const psa_algorithm_t | alg, | ||
struct test_result_t * | ret | ||
) |
Run AEAD tests with different algorithms and key types.
[in] | key_type | PSA key type |
[in] | alg | PSA algorithm |
[out] | ret | Test result |
Definition at line 650 of file crypto_tests_common.c.
void psa_cipher_test | ( | const psa_key_type_t | key_type, |
const psa_algorithm_t | alg, | ||
struct test_result_t * | ret | ||
) |
Run block ciphering tests with different algorithms and key types.
[in] | key_type | PSA key type |
[in] | alg | PSA algorithm |
[out] | ret | Test result |
Definition at line 96 of file crypto_tests_common.c.
void psa_hash_test | ( | const psa_algorithm_t | alg, |
struct test_result_t * | ret | ||
) |
Tests different hashing algorithms.
[in] | alg | PSA algorithm |
[out] | ret | Test result |
Definition at line 415 of file crypto_tests_common.c.
void psa_invalid_cipher_test | ( | const psa_key_type_t | key_type, |
const psa_algorithm_t | alg, | ||
const size_t | key_size, | ||
struct test_result_t * | ret | ||
) |
Tests invalid key type and algorithm combinations for block ciphers.
[in] | key_type | PSA key type |
[in] | alg | PSA algorithm |
[in] | key_size | Key size |
[out] | ret | Test result |
Definition at line 312 of file crypto_tests_common.c.
void psa_invalid_key_length_test | ( | struct test_result_t * | ret | ) |
Tests invalid key length.
[out] | ret | Test result |
Definition at line 800 of file crypto_tests_common.c.
void psa_key_derivation_test | ( | psa_algorithm_t | deriv_alg, |
struct test_result_t * | ret | ||
) |
Key derivation test.
[in] | deriv_alg | Key derivation algorithm |
[out] | ret | Test result |
Definition at line 1059 of file crypto_tests_common.c.
void psa_key_interface_test | ( | const psa_key_type_t | key_type, |
struct test_result_t * | ret | ||
) |
Tests the key interfaces with different key types.
[in] | key_type | PSA key type |
[out] | ret | Test result |
Definition at line 15 of file crypto_tests_common.c.
void psa_mac_test | ( | const psa_algorithm_t | alg, |
uint8_t | use_long_key, | ||
struct test_result_t * | ret | ||
) |
Tests different MAC algorithms.
[in] | alg | PSA algorithm |
[in] | use_long_key | Flag used to indicate to use the long test key |
[out] | ret | Test result |
Definition at line 534 of file crypto_tests_common.c.
void psa_persistent_key_test | ( | psa_key_id_t | key_id, |
struct test_result_t * | ret | ||
) |
Tests persistent keys.
[out] | ret | Test result |
Definition at line 973 of file crypto_tests_common.c.
void psa_policy_invalid_policy_usage_test | ( | struct test_result_t * | ret | ) |
Tests invalid policy usage.
[out] | ret | Test result |
Definition at line 884 of file crypto_tests_common.c.
void psa_policy_key_interface_test | ( | struct test_result_t * | ret | ) |
Tests the policy key interface.
[out] | ret | Test result |
Definition at line 827 of file crypto_tests_common.c.
void psa_unsupported_hash_test | ( | const psa_algorithm_t | alg, |
struct test_result_t * | ret | ||
) |
Tests setup of an unsupported hash algorithm.
[in] | alg | PSA algorithm |
[out] | ret | Test result |
Definition at line 361 of file crypto_tests_common.c.
void psa_unsupported_mac_test | ( | const psa_key_type_t | key_type, |
const psa_algorithm_t | alg, | ||
struct test_result_t * | ret | ||
) |
Tests setup of an unsupported MAC algorithm.
[in] | key_type | PSA key type |
[in] | alg | PSA algorithm |
[out] | ret | Test result |
Definition at line 464 of file crypto_tests_common.c.