enabling remaining test checks for key derivation
diff --git a/api-tests/dev_apis/crypto/test_c021/test_c021.c b/api-tests/dev_apis/crypto/test_c021/test_c021.c
index 477ff16..5f6c5d6 100644
--- a/api-tests/dev_apis/crypto/test_c021/test_c021.c
+++ b/api-tests/dev_apis/crypto/test_c021/test_c021.c
@@ -59,6 +59,9 @@
{
val->print(PRINT_TEST, "[Check %d] ", g_test_count++);
val->print(PRINT_TEST, check1[i].test_desc, 0);
+ memset(&operation,0,sizeof(psa_key_derivation_operation_t));
+ //attributes = PSA_KEY_ATTRIBUTES_INIT;
+ //derv_attributes = PSA_KEY_ATTRIBUTES_INIT;
/* Setting up the watchdog timer for each check */
status = val->wd_reprogram_timer(WD_CRYPTO_TIMEOUT);
@@ -95,20 +98,19 @@
status = val->crypto_function(VAL_CRYPTO_KEY_DERIVATION_INPUT_KEY, &operation,
check1[i].step, key);
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(6));
+ status = val->crypto_function(VAL_CRYPTO_KEY_DERIVATION_INPUT_BYTES, &operation,
+ PSA_KEY_DERIVATION_INPUT_INFO,
+ input_info,
+ INPUT_INFO_LEN);
+ TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(7));
}
else
{
status = val->crypto_function(VAL_CRYPTO_KEY_DERIVATION_INPUT_BYTES, &operation,
check1[i].step, check1[i].data, check1[i].data_length);
- TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(7));
+ TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(6));
}
- status = val->crypto_function(VAL_CRYPTO_KEY_DERIVATION_INPUT_BYTES, &operation,
- check1[i].info.step,
- check1[i].info.data,
- check1[i].info.data_length);
- TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(8));
-
/* Setup the attributes for the key */
val->crypto_function(VAL_CRYPTO_SET_KEY_TYPE, &derv_attributes, check1[i].derive_key_type);
val->crypto_function(VAL_CRYPTO_SET_KEY_BITS, &derv_attributes, check1[i].derive_key_bits);
diff --git a/api-tests/dev_apis/crypto/test_c021/test_data.h b/api-tests/dev_apis/crypto/test_c021/test_data.h
index 4d09ab3..5deaa1c 100644
--- a/api-tests/dev_apis/crypto/test_c021/test_data.h
+++ b/api-tests/dev_apis/crypto/test_c021/test_data.h
@@ -18,11 +18,6 @@
#include "val_crypto.h"
#include "test_crypto_common.h"
-typedef struct {
- psa_key_derivation_step_t step;
- const uint8_t *data;
- size_t data_length;
-} key_derivation_input_t;
typedef struct {
char test_desc[75];
@@ -39,7 +34,6 @@
size_t derive_key_bits;
psa_key_usage_t derive_usage;
psa_algorithm_t derive_key_alg;
- key_derivation_input_t info;
psa_status_t expected_status;
} test_data;
@@ -52,14 +46,8 @@
PSA_KEY_DERIVATION_INPUT_SECRET, 32, {0}, 0,
PSA_KEY_TYPE_AES, BYTES_TO_BITS(AES_32B_KEY_SIZE), PSA_KEY_USAGE_EXPORT,
PSA_ALG_CTR,
- {
- .step = PSA_KEY_DERIVATION_INPUT_INFO,
- .data = input_info,
- .data_length = INPUT_INFO_LEN
- },
PSA_SUCCESS
},
-#if 0
{"Test psa_key_derivation_output_key - Info\n", PSA_KEY_TYPE_DERIVE,
{0x49, 0x8E, 0xC7, 0x7D, 0x01, 0x95, 0x0D, 0x94, 0x2C, 0x16, 0xA5, 0x3E, 0x99,
0x5F, 0xC9, 0x77},
@@ -158,5 +146,4 @@
PSA_ALG_CTR,
PSA_ERROR_NOT_SUPPORTED
},
-#endif
};