mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
Merge branch 'bugfix/hardware_mpi_sign' into 'master'
hwcrypto mpi: Fix losing sign when multiplying by -1 (github PR) Contribution from github: https://github.com/espressif/esp-idf/pull/1181/ See merge request !1471
This commit is contained in:
@ -497,10 +497,14 @@ int mbedtls_mpi_mul_mpi( mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (bits_x == 1) {
|
if (bits_x == 1) {
|
||||||
return mbedtls_mpi_copy(Z, Y);
|
ret = mbedtls_mpi_copy(Z, Y);
|
||||||
|
Z->s *= X->s;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
if (bits_y == 1) {
|
if (bits_y == 1) {
|
||||||
return mbedtls_mpi_copy(Z, X);
|
ret = mbedtls_mpi_copy(Z, X);
|
||||||
|
Z->s *= Y->s;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
words_mult = (words_x > words_y ? words_x : words_y);
|
words_mult = (words_x > words_y ? words_x : words_y);
|
||||||
|
Reference in New Issue
Block a user