MPI: add kconfig option for doing intr-based exp-mod operations

This commit is contained in:
Marius Vikhammer
2021-12-28 12:04:05 +08:00
parent e8cfba0745
commit a9a7160cb6
9 changed files with 176 additions and 2 deletions

View File

@@ -45,6 +45,7 @@ void esp_mpi_enable_hardware_hw_op( void )
}
// Note: from enabling RSA clock to here takes about 1.3us
REG_WRITE(RSA_INTERRUPT_REG, 0);
}
@@ -56,6 +57,15 @@ void esp_mpi_disable_hardware_hw_op( void )
periph_module_disable(PERIPH_RSA_MODULE);
}
void esp_mpi_interrupt_enable( bool enable )
{
REG_WRITE(RSA_INTERRUPT_REG, enable);
}
void esp_mpi_interrupt_clear( void )
{
REG_WRITE(RSA_CLEAR_INTERRUPT_REG, 1);
}
/* Copy mbedTLS MPI bignum 'mpi' to hardware memory block at 'mem_base'.