Add checks to guarantee positive input parameters

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2023-04-13 13:12:00 +02:00
parent bda7f87e2a
commit b70f5f1881
No known key found for this signature in database
GPG Key ID: F072ACA227ACD71D

View File

@ -1378,6 +1378,9 @@ void ecp_mod_p192k1(char *input_N,
limbs_X = X.n;
limbs_N = N.n;
limbs_res = res.n;
TEST_ASSERT(mbedtls_mpi_core_uint_le_mpi(0, X.p, X.n));
TEST_ASSERT(mbedtls_mpi_core_uint_le_mpi(0, N.p, N.n));
TEST_ASSERT(mbedtls_mpi_core_uint_le_mpi(0, res.p, res.n));
size_t limbs = limbs_N;
size_t bytes = limbs * sizeof(mbedtls_mpi_uint);