From 49d440372f22f1fe19b7a01a1db7a4e7613fe0a0 Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Thu, 22 Aug 2024 09:07:26 +0100 Subject: [PATCH] tf-psa-crypto/drivers/builtin/src/ecp.c Update tf-psa-crypto/drivers/builtin/src/ecp.c Co-authored-by: Gilles Peskine Signed-off-by: Minos Galanakis --- library/ecp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ecp.c b/library/ecp.c index cfe02b0d2c..2ed735d754 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -3125,7 +3125,7 @@ int mbedtls_ecp_check_privkey(const mbedtls_ecp_group *grp, /* see RFC 7748 sec. 5 para. 5 */ if (mbedtls_mpi_get_bit(d, 0) != 0 || mbedtls_mpi_get_bit(d, 1) != 0 || - mbedtls_mpi_bitlen(d) - 1 != grp->nbits) { /* mbedtls_mpi_bitlen is one-based! */ + mbedtls_mpi_bitlen(d) != grp->nbits + 1) { /* mbedtls_mpi_bitlen is one-based! */ return MBEDTLS_ERR_ECP_INVALID_KEY; }