pub struct RsaModularMultiplication<'a, 'd, T, Dm>where
    T: RsaMode,
    Dm: DriverMode,{ /* private fields */ }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<'a, 'd, T, Dm, const N: usize> RsaModularMultiplication<'a, 'd, T, Dm>where
    T: RsaMode<InputType = [u32; N]>,
    Dm: DriverMode,
 
impl<'a, 'd, T, Dm, const N: usize> RsaModularMultiplication<'a, 'd, T, Dm>where
    T: RsaMode<InputType = [u32; N]>,
    Dm: DriverMode,
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.
- rcan be calculated using- 2 ^ ( bitlength * 2 ) mod modulus.
- m_primecan be calculated using- -(modular multiplicative inverse of modulus) mod 2^32.
For more information refer to the Technical Reference Manual
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 the Technical Reference Manual
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 blocking function: it waits for the RSA operation to complete,
then reads the results into the provided buffer. start_modular_multiplication must be
called before calling this function.
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.