esp_hal::rsa

Struct RsaMultiplication

Source
pub struct RsaMultiplication<'a, 'd, T: RsaMode + Multi, DM: Mode> { /* private fields */ }
Expand description

Support for RSA peripheral’s large number multiplication feature that could be used to find the operand a * operand b.

Each operand is a little endian byte array of the same size

Implementations§

Source§

impl<T, const N: usize> RsaMultiplication<'_, '_, T, Async>
where T: RsaMode<InputType = [u32; N]> + RsaMode + Multi,

Source

pub async fn multiplication<const O: usize>( &mut self, operand_b: &T::InputType, outbuf: &mut T::OutputType, )
where T: Multi<OutputType = [u32; O]>,

Asynchronously performs an RSA multiplication operation.

Source§

impl<'a, 'd, T, DM: Mode, const N: usize> RsaMultiplication<'a, 'd, T, DM>
where T: RsaMode<InputType = [u32; N]> + RsaMode + Multi,

Source

pub fn new(rsa: &'a mut Rsa<'d, DM>, operand_a: &T::InputType) -> Self

Creates an instance of RsaMultiplication.

Source

pub fn start_multiplication(&mut self, operand_b: &T::InputType)

Starts the multiplication operation.

Source

pub fn read_results<const O: usize>(&mut self, outbuf: &mut T::OutputType)
where T: Multi<OutputType = [u32; O]>,

Reads the result to the given buffer. This is a non blocking function that returns without an error if operation is completed successfully. start_multiplication must be called before calling this function.

Auto Trait Implementations§

§

impl<'a, 'd, T, DM> Freeze for RsaMultiplication<'a, 'd, T, DM>

§

impl<'a, 'd, T, DM> RefUnwindSafe for RsaMultiplication<'a, 'd, T, DM>

§

impl<'a, 'd, T, DM> Send for RsaMultiplication<'a, 'd, T, DM>
where T: Send, DM: Send,

§

impl<'a, 'd, T, DM> Sync for RsaMultiplication<'a, 'd, T, DM>
where T: Sync, DM: Sync,

§

impl<'a, 'd, T, DM> Unpin for RsaMultiplication<'a, 'd, T, DM>
where T: Unpin,

§

impl<'a, 'd, T, DM> !UnwindSafe for RsaMultiplication<'a, 'd, T, DM>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.