pub struct RsaBackend<'d> { /* private fields */ }Expand description
RSA processing backend.
The backend processes work items placed in the RSA work queue. The backend needs to be created and started for operations to be processed. This allows you to perform operations on the RSA accelerator without carrying around the peripheral singleton, or the driver.
The RsaContext struct can enqueue work items that this backend will process.
§Example
use esp_hal::rsa::{RsaBackend, RsaContext, operand_sizes::Op512};
let mut rsa_backend = RsaBackend::new(peripherals.RSA);
let _driver = rsa_backend.start();
async fn perform_512bit_big_number_multiplication(
    operand_a: &[u32; 16],
    operand_b: &[u32; 16],
    result: &mut [u32; 32],
) {
    let mut rsa = RsaContext::new();
    let mut handle = rsa.multiply::<Op512>(operand_a, operand_b, result);
    handle.wait().await;
}Implementations§
Source§impl<'d> RsaBackend<'d>
 
impl<'d> RsaBackend<'d>
Sourcepub fn new(rsa: RSA<'d>) -> Self
 
pub fn new(rsa: RSA<'d>) -> Self
Creates a new RSA backend.
§Example
use esp_hal::rsa::RsaBackend;
let mut rsa = RsaBackend::new(peripherals.RSA);Sourcepub fn start(&mut self) -> RsaWorkQueueDriver<'_, 'd>
 
pub fn start(&mut self) -> RsaWorkQueueDriver<'_, 'd>
Registers the RSA driver to process RSA operations.
The driver stops operating when the returned object is dropped.
§Example
use esp_hal::rsa::RsaBackend;
let mut rsa = RsaBackend::new(peripherals.RSA);
// Start the backend, which allows processing RSA operations.
let _backend = rsa.start();