pub struct RsaModularMultiplication<'a, 'd, T: RsaMode, Dm: DriverMode> { /* private fields */ }
unstable
only.Expand description
Support for RSA peripheral’s modular multiplication feature that could be
used to find the (operand a * operand b) mod modulus
.
Each operand is a little endian byte array of the same size
Implementations§
Source§impl<T, const N: usize> RsaModularMultiplication<'_, '_, T, Async>
impl<T, const N: usize> RsaModularMultiplication<'_, '_, T, Async>
Sourcepub async fn modular_multiplication(
&mut self,
operand_b: &T::InputType,
outbuf: &mut T::InputType,
)
pub async fn modular_multiplication( &mut self, operand_b: &T::InputType, outbuf: &mut T::InputType, )
Asynchronously performs an RSA modular multiplication operation.
Source§impl<'a, 'd, T, Dm: DriverMode, const N: usize> RsaModularMultiplication<'a, 'd, T, Dm>
impl<'a, 'd, T, Dm: DriverMode, const N: usize> RsaModularMultiplication<'a, 'd, T, Dm>
Sourcepub fn new(
rsa: &'a mut Rsa<'d, Dm>,
operand_a: &T::InputType,
modulus: &T::InputType,
r: &T::InputType,
m_prime: u32,
) -> Self
pub fn new( rsa: &'a mut Rsa<'d, Dm>, operand_a: &T::InputType, modulus: &T::InputType, r: &T::InputType, m_prime: u32, ) -> Self
Creates an instance of RsaModularMultiplication
.
r
can be calculated using2 ^ ( bitlength * 2 ) mod modulus
.m_prime
can be calculated using-(modular multiplicative inverse of modulus) mod 2^32
.
For more information refer to 20.3.1 of https://www.espressif.com/sites/default/files/documentation/esp32-s3_technical_reference_manual_en.pdf.
Sourcepub fn start_modular_multiplication(&mut self, operand_b: &T::InputType)
pub fn start_modular_multiplication(&mut self, operand_b: &T::InputType)
Starts the modular multiplication operation.
For more information refer to 19.3.1 of https://www.espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf.
Sourcepub fn read_results(&mut self, outbuf: &mut T::InputType)
pub fn read_results(&mut self, outbuf: &mut T::InputType)
Reads the result to the given buffer. This is a non blocking function that returns without an error if operation is completed successfully.