mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
Add hkdf_extract, hkdf_expand and ecjpake_to_pms cases
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
This commit is contained in:
@@ -414,6 +414,21 @@ int mbedtls_test_psa_setup_key_derivation_wrap(
|
|||||||
PSA_KEY_DERIVATION_INPUT_INFO,
|
PSA_KEY_DERIVATION_INPUT_INFO,
|
||||||
input2,
|
input2,
|
||||||
input2_length));
|
input2_length));
|
||||||
|
} else if (PSA_ALG_IS_HKDF_EXTRACT(alg)) {
|
||||||
|
PSA_ASSERT(psa_key_derivation_input_bytes(operation,
|
||||||
|
PSA_KEY_DERIVATION_INPUT_SALT,
|
||||||
|
input1, input1_length));
|
||||||
|
PSA_ASSERT(psa_key_derivation_input_key(operation,
|
||||||
|
PSA_KEY_DERIVATION_INPUT_SECRET,
|
||||||
|
key));
|
||||||
|
} else if (PSA_ALG_IS_HKDF_EXPAND(alg)) {
|
||||||
|
PSA_ASSERT(psa_key_derivation_input_key(operation,
|
||||||
|
PSA_KEY_DERIVATION_INPUT_SECRET,
|
||||||
|
key));
|
||||||
|
PSA_ASSERT(psa_key_derivation_input_bytes(operation,
|
||||||
|
PSA_KEY_DERIVATION_INPUT_INFO,
|
||||||
|
input2,
|
||||||
|
input2_length));
|
||||||
} else if (PSA_ALG_IS_TLS12_PRF(alg) ||
|
} else if (PSA_ALG_IS_TLS12_PRF(alg) ||
|
||||||
PSA_ALG_IS_TLS12_PSK_TO_MS(alg)) {
|
PSA_ALG_IS_TLS12_PSK_TO_MS(alg)) {
|
||||||
PSA_ASSERT(psa_key_derivation_input_bytes(operation,
|
PSA_ASSERT(psa_key_derivation_input_bytes(operation,
|
||||||
@@ -436,6 +451,10 @@ int mbedtls_test_psa_setup_key_derivation_wrap(
|
|||||||
PSA_ASSERT(psa_key_derivation_input_key(operation,
|
PSA_ASSERT(psa_key_derivation_input_key(operation,
|
||||||
PSA_KEY_DERIVATION_INPUT_PASSWORD,
|
PSA_KEY_DERIVATION_INPUT_PASSWORD,
|
||||||
key));
|
key));
|
||||||
|
} else if (alg == PSA_ALG_TLS12_ECJPAKE_TO_PMS) {
|
||||||
|
PSA_ASSERT(psa_key_derivation_input_bytes(operation,
|
||||||
|
PSA_KEY_DERIVATION_INPUT_SECRET,
|
||||||
|
input1, input1_length));
|
||||||
} else {
|
} else {
|
||||||
TEST_FAIL("Key derivation algorithm not supported");
|
TEST_FAIL("Key derivation algorithm not supported");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user