RSA. How to decrypt RSA encrypted file

#1

How to decrypt RSA encrypted file.
My case: iOS Mobile app sends RSA encrypted by public key data to the FW. FW should decrypt it by private key.

I found that I can do this via mbedtls.
But linker generates errors:

  • undefined reference to `mbedtls_entropy_func’
  • undefined reference to `mbedtls_ctr_drbg_random’

As I understood, mos doesn’t include these functions into libmbedtls-esp32-2.18.0.
Is it possible to decrypt data on mongoose os via mbedtls or I should find another library?

#2

As I understand from reading other posts, mbedtls is precompiled and just linked at build time so you are not able to change any part of it.
The ESP32 has a hardware accelerator for elliptic curve algorithms and mOS libraries take advantage of this, you should try and go this way if possible.
In theory you could include your own version of mbedtls in deps/, and for correct operation you should also keep the official precompiled one. Avoiding name clashing would probably be a nightmare, perhaps you could locally add only those missing parts you need… (just thinking outloud while typing)