From e18f841a34cbf244bf3f58419b5f9b4364bdc59a Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Fri, 18 Aug 2023 16:46:37 +0200 Subject: [PATCH] Fix Edwards load key. It did not compute the correct public point. Signed-off-by: Pol Henarejos --- src/fido/fido.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fido/fido.c b/src/fido/fido.c index 932180f..fab4a5e 100644 --- a/src/fido/fido.c +++ b/src/fido/fido.c @@ -282,6 +282,9 @@ int derive_key(const uint8_t *app_id, if (r != 0) { return r; } + if (curve == MBEDTLS_ECP_DP_ED25519) { + return mbedtls_ecp_point_edwards(&key->grp, &key->Q, &key->d, random_gen, NULL); + } return mbedtls_ecp_mul(&key->grp, &key->Q, &key->d, &key->grp.G, random_gen, NULL); } mbedtls_platform_zeroize(outk, sizeof(outk));