mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-22 13:20:50 +00:00
ecp_curves: Reintroduced input checking for
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
parent
65c386ee3d
commit
31f0b452c7
@ -5431,6 +5431,13 @@ cleanup:
|
||||
MBEDTLS_STATIC_TESTABLE
|
||||
int mbedtls_ecp_mod_p255_raw(mbedtls_mpi_uint *X, size_t X_Limbs)
|
||||
{
|
||||
|
||||
if (X_Limbs > 2*P255_WIDTH) {
|
||||
X_Limbs = 2*P255_WIDTH;
|
||||
} else if (X_Limbs < P255_WIDTH) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
mbedtls_mpi_uint *carry = mbedtls_calloc(P255_WIDTH, ciL);
|
||||
if (carry == NULL) {
|
||||
return MBEDTLS_ERR_ECP_ALLOC_FAILED;
|
||||
|
Loading…
x
Reference in New Issue
Block a user