pk: add an alternative function for checking private/public key pairs
Instead of using the legacy mbedtls_ecp_check_pub_priv() function which
was based on ECP math, we add a new option named eckey_check_pair_psa()
which takes advantage of PSA.
Of course, this is available when MBEDTLS_USE_PSA_CRYPTO in enabled.
Tests were also fixed accordingly.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
diff --git a/library/ecp.c b/library/ecp.c
index 08fbe86..a794b3b 100644
--- a/library/ecp.c
+++ b/library/ecp.c
@@ -3316,7 +3316,7 @@
return ret;
}
-
+#if !defined(MBEDTLS_USE_PSA_CRYPTO)
/*
* Check a public-private key pair
*/
@@ -3357,6 +3357,7 @@
return ret;
}
+#endif /* !MBEDTLS_USE_PSA_CRYPTO */
/*
* Export generic key-pair parameters.