libmbedtls: bignum: restore mbedtls_mpi_exp_mod() from v3.5.2

The implementation of mbedtls_mpi_exp_mod() in Mbed TLS v3.6.0
introduces a large performance regression in "xtest 4011" on QEMUv7
(32-bit). One iteration of the test used to take 1.4 second on my
machine but the newer implementation now needs 23 seconds. To make
matters worse, xtest 4011 runs ten iterations so in reality it is
14 seconds vs. almost 4 minutes for the whole test.
Revert mbedtls_mpi_exp_mod() to the v3.5.2 implementation to gain the
performance back. The upstream commit that changed the algorithm is
[2]. Note that some mpi_* static functions have been made non static
and renamed mbedtls_mpi_* in the current Mbed TLS so the code from
v3.5.2 is modified accordingly.

Link: https://optee.readthedocs.io/en/latest/building/devices/qemu.html#qemu-v7 [1]
Link: https://github.com/Mbed-TLS/mbedtls/commit/1ba40585f9446372f69f19693c20f593283930af [2]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
1 file changed
tree: 6738abea153f01ad120b44ff4d429acc36304dc3
  1. .github/
  2. core/
  3. keys/
  4. ldelf/
  5. lib/
  6. mk/
  7. scripts/
  8. ta/
  9. .checkpatch.conf
  10. .clang-format
  11. .gitattributes
  12. .gitignore
  13. CHANGELOG.md
  14. LICENSE
  15. MAINTAINERS
  16. Makefile
  17. README.md
  18. typedefs.checkpatch
README.md

OP-TEE Trusted OS

This git contains source code for the secure side implementation of OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io.

// OP-TEE core maintainers