mbedtls: Fix a case for mpi_montgomery_exp_calc() when Z is not init

Closes: IDF-1870
This commit is contained in:
KonstantinKondrashov
2020-07-07 02:01:44 +08:00
parent f29370b02c
commit 11844a54f4
2 changed files with 44 additions and 12 deletions
+1 -1
View File
@@ -204,7 +204,7 @@ int esp_mont_hw_op(mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi *Y, c
mpi_to_mem_block(RSA_MEM_RB_BLOCK_BASE, Y, hw_words);
start_op(RSA_MULT_START_REG);
Z->s = 1; // The sign of Z will be = M->s (but M->s is always 1)
MBEDTLS_MPI_CHK( mbedtls_mpi_grow(Z, hw_words) );
wait_op_complete();