mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-09-14 06:09:57 +00:00
tf-psa-crypto/drivers/builtin/src/ecp.c
Update tf-psa-crypto/drivers/builtin/src/ecp.c Co-authored-by: Gilles Peskine <[email protected]> Signed-off-by: Minos Galanakis <[email protected]>
This commit is contained in:
co-authored by
Gilles Peskine
parent
32fe8f3cf1
commit
49d440372f
+1
-1
@@ -3125,7 +3125,7 @@ int mbedtls_ecp_check_privkey(const mbedtls_ecp_group *grp,
|
|||||||
/* see RFC 7748 sec. 5 para. 5 */
|
/* see RFC 7748 sec. 5 para. 5 */
|
||||||
if (mbedtls_mpi_get_bit(d, 0) != 0 ||
|
if (mbedtls_mpi_get_bit(d, 0) != 0 ||
|
||||||
mbedtls_mpi_get_bit(d, 1) != 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;
|
return MBEDTLS_ERR_ECP_INVALID_KEY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user