esp_mpi_acquire_hardware() function
This is a wrapper for the main mbedtls/bignum.h. This wrapper provides a few additional ESP32-only functions. This is because we don't set MBEDTLS_BIGNUM_ALT in the same way we do for AES, SHA, etc. Because we still use most of the bignum.h implementation and just replace a few hardware accelerated functions (see MBEDTLS_MPI_EXP_MOD_ALT & MBEDTLS_MPI_MUL_MPI_ALT in esp_config.h). Lock access to RSA Accelerator (MPI/bignum operations) RSA Accelerator hardware unit can only be used by one consumer at a time.
Syntax
void esp_mpi_acquire_hardware(void);
Notes
Unlike the other hardware accelerator support functions in esp32/hwcrypto, there is no generic "hwcrypto/bignum.h" header for using these functions without mbedTLS. The reason for this is that all of the function implementations depend strongly upon the mbedTLS MPI implementation. This function is non-recursive (do not call it twice from the same task.) You do not need to call this if you are using the mbedTLS bignum.h API or esp_mpi_xxx functions. This function is only needed if you want to call ROM RSA functions or access the registers directly.
![]()
void esp_mpi_acquire_hardware(void);