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>
impl<'a, 'd, T, Dm, 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.
rcan be calculated using2 ^ ( 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.
Auto Trait Implementations§
impl<'a, 'd, T, Dm> Freeze for RsaModularMultiplication<'a, 'd, T, Dm>
impl<'a, 'd, T, Dm> RefUnwindSafe for RsaModularMultiplication<'a, 'd, T, Dm>where
T: RefUnwindSafe,
Dm: RefUnwindSafe,
impl<'a, 'd, T, Dm> Send for RsaModularMultiplication<'a, 'd, T, Dm>
impl<'a, 'd, T, Dm> Sync for RsaModularMultiplication<'a, 'd, T, Dm>
impl<'a, 'd, T, Dm> Unpin for RsaModularMultiplication<'a, 'd, T, Dm>where
T: Unpin,
impl<'a, 'd, T, Dm> !UnwindSafe for RsaModularMultiplication<'a, 'd, T, Dm>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more