Add EdDSA support as a conditional build.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2025-02-21 20:29:42 +01:00
parent ddb6b4b936
commit 6de499e435
3 changed files with 17 additions and 4 deletions

View File

@@ -177,10 +177,13 @@ int cmd_import_data() {
mbedtls_ecp_keypair_free(&ecdsa);
return SW_EXEC_ERROR();
}
#ifdef MBEDTLS_EDDSA_C
if (ecdsa.grp.id == MBEDTLS_ECP_DP_ED25519) {
r = mbedtls_ecp_point_edwards(&ecdsa.grp, &ecdsa.Q, &ecdsa.d, random_gen, NULL);
}
else {
else
#endif
{
r = mbedtls_ecp_mul(&ecdsa.grp, &ecdsa.Q, &ecdsa.d, &ecdsa.grp.G, random_gen, NULL);
}
if (r != 0) {