]> granicus.if.org Git - esp-idf/commitdiff
mbedtls: Add UTs for modexp
authorKonstantin Kondrashov <konstantin@espressif.com>
Thu, 13 Jun 2019 14:09:50 +0000 (22:09 +0800)
committerKonstantin Kondrashov <konstantin@espressif.com>
Wed, 26 Jun 2019 11:33:47 +0000 (19:33 +0800)
components/mbedtls/port/esp_bignum.c
components/mbedtls/test/test_mbedtls_mpi.c

index 86589068be061ea6fccaca826b8ae8f90129ff47..b261cbf494ebc6a51726531bf7b32631c25fcd79 100644 (file)
@@ -419,7 +419,7 @@ int mbedtls_mpi_exp_mod( mbedtls_mpi* Z, const mbedtls_mpi* X, const mbedtls_mpi
         Z->s = -1;
         MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(Z, M, Z));
     } else {
-        Z->s = 1;
+        Z->s = 1; 
     }
 
  cleanup:
index bd02437c7387cbf203c75ac32fb1554d155f9202..084fe34845f306d19c2d4bcd4e6526d649679258 100644 (file)
@@ -140,12 +140,6 @@ static bool test_bignum_modexp(const char *z_str, const char *x_str, const char
     //mbedtls_mpi_printf("M", &M);
 
     /* Z = (X ^ Y) mod M */
-<<<<<<< HEAD
-    TEST_ASSERT_FALSE(mbedtls_mpi_exp_mod(&Z, &X, &Y, &M, NULL));
-
-    mbedtls_mpi_write_string(&Z, 16, z_buf, sizeof(z_buf)-1, &z_buf_len);
-    TEST_ASSERT_EQUAL_STRING_MESSAGE(z_str, z_buf, "mbedtls_mpi_exp_mod incorrect");
-=======
     if (ret_error != mbedtls_mpi_exp_mod(&Z, &X, &Y, &M, NULL)) {
         fail = true;
     }
@@ -169,7 +163,6 @@ static bool test_bignum_modexp(const char *z_str, const char *x_str, const char
         printf(" PASS\n");
     }
     return fail;
->>>>>>> mbedtls: Add UTs for modexp
 }
 
 TEST_CASE("test MPI modexp", "[bignum]")