ProtoCore v0.0.2
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
esp_crypto_hal.cpp File Reference

Real-HAL implementation: single-owner RSA/MPI accelerator, brought up by DIRECT register writes. More...

Go to the source code of this file.

Detailed Description

Real-HAL implementation: single-owner RSA/MPI accelerator, brought up by DIRECT register writes.

Self-contained: uses only this HAL's own register map (esp_crypto_hal.h) and FreeRTOS for the one shared exclusivity mutex - no soc/ header, no esp_mpi_* / mpi_hal_* / mpi_ll_* symbol. The exclusivity mutex must be ONE global instance shared by every translation unit that drives the accelerator, so acquire/release live here (a header-only static would give each TU its own copy - not a lock).

Bring-up is ON DEMAND and the peripheral is then LEFT running: a run of MODMULTs is stateless (each reloads all operands), so re-resetting/power-cycling between ops is unnecessary - and, measured on-device, a per-op power-cycle is not even deterministic (a re-init right after a teardown can return a wrong first result). We bring up only when the peripheral is not already clocked+powered: at cold boot, or after another RSA- peripheral user (e.g. mbedTLS RSA/DH) powered it down on its own teardown. Detection reads the clock-domain registers (always accessible), never the possibly-unclocked RSA block.

Definition in file esp_crypto_hal.cpp.