|
DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
|
ESP32-S3 GF(2^255-19) field layer on the RSA/MPI hardware accelerator (X25519 + Ed25519). More...
#include <stdint.h>#include "sdkconfig.h"Go to the source code of this file.
ESP32-S3 GF(2^255-19) field layer on the RSA/MPI hardware accelerator (X25519 + Ed25519).
Field elements are canonical uint32[8] (< p = 2^255-19) so every field multiply is a single 256-bit modular multiply on the S3 RSA accelerator (~1,386 cycles vs 7,955 for the software SIMD ssh_gf_mul). add/sub are native 32-bit (carry + one conditional subtract of p); bytes<->fe is a per-scalar-mult conversion, not per multiply. This is the shared engine behind both the X25519 KEX (ssh_curve25519.cpp) and the Ed25519 host-key signature (ssh_ed25519.cpp) on the S3; the radix-2^16 ssh_gf path is the native / non-S3 fallback in both.
The accelerator (and its lock) are shared with mbedTLS RSA/DH, so a scalar-mult brackets itself with ssh_fe_hw_enable() / ssh_fe_hw_disable() (mbedTLS's own esp_mpi_{enable,disable}_hardware_hw_op, i.e. acquire the MPI lock + clock/power the peripheral) and holds the lock for its whole run.
Header-only static inline on purpose: the cheap ops (add/sub/cswap) inline into the ladder in each translation unit with no cross-TU call overhead, and the whole layer stays one source of truth.
Definition in file ssh_fe25519.h.