Module esp32c3_hal::rsa
source · Expand description
RSA Accelerator support.
Overview
The RSA driver provides a set of functions to accelerate RSA (Rivest–Shamir–Adleman) cryptographic operations on ESP chips. RSA is a
widely used public-key cryptographic algorithm that involves complex
mathematical computations, and the RSA accelerator on ESP chips is
designed to optimize these computations for faster performance.
Implementation details;
- The driver uses low-level peripheral access to read and write data
from/to the
RSAperipheral. - The driver contains
unsafecode blocks as it directly manipulates memory addresses for data transfer. - The driver supports different sizes of operands based on the generic types provided during instantiation.
- The nb crate is used to handle non-blocking operations.
- The driver provides a set of high-level abstractions to simplify
RSAcryptographic operations onESPchips, allowing developers to leverage theRSA acceleratorfor improved performance.
Examples
Initialization
let peripherals = Peripherals::take();
let mut system = peripherals.PCR.split();
let mut rsa = Rsa::new(peripherals.RSA, &mut system.peripheral_clock_control);⚠️: The examples for RSA peripheral are quite extensive, so for a more detailed study of how to use this driver please visit the repository with corresponding example.
Modules
- Marker types for the operand sizes
Structs
- RSA peripheral container
- Support for RSA peripheral’s modular exponentiation feature that could be used to find the
(base ^ exponent) mod modulus. - Support for RSA peripheral’s modular multiplication feature that could be used to find the
(operand a * operand b) mod modulus. - Support for RSA peripheral’s large number multiplication feature that could be used to find the
operand a * operand b.