Explorar o código

Merge branch 'feature/mbedtls_bignum' into 'master'

mbedtls: Fix rsa test

See merge request espressif/esp-idf!12578
Angus Gratton %!s(int64=4) %!d(string=hai) anos
pai
achega
a13be9f40c
Modificáronse 2 ficheiros con 3 adicións e 5 borrados
  1. 3 3
      components/mbedtls/port/esp_bignum.c
  2. 0 2
      components/mbedtls/test/test_rsa.c

+ 3 - 3
components/mbedtls/port/esp_bignum.c

@@ -64,12 +64,12 @@ static inline size_t bits_to_words(size_t bits)
     return (bits + 31) / 32;
 }
 
-/* Return the number of words actually used to represent an mpi
-   number.
-*/
 int __wrap_mbedtls_mpi_exp_mod( mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M, mbedtls_mpi *_Rinv );
 extern int __real_mbedtls_mpi_exp_mod( mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M, mbedtls_mpi *_Rinv );
 
+/* Return the number of words actually used to represent an mpi
+   number.
+*/
 static size_t mpi_words(const mbedtls_mpi *mpi)
 {
     for (size_t i = mpi->n; i > 0; i--) {

+ 0 - 2
components/mbedtls/test/test_rsa.c

@@ -504,8 +504,6 @@ static void rsa_key_operations(int keysize, bool check_performance, bool use_bli
     private_perf = ccomp_timer_stop();
     TEST_ASSERT_EQUAL_HEX16(0, -res);
 
-    private_perf = ccomp_timer_stop();
-
     if (check_performance && keysize == 2048) {
         TEST_PERFORMANCE_CCOMP_LESS_THAN(RSA_2048KEY_PUBLIC_OP, "public operations %d us", public_perf);
         TEST_PERFORMANCE_CCOMP_LESS_THAN(RSA_2048KEY_PRIVATE_OP, "private operations %d us", private_perf);