Struct Otbn

Source
pub struct Otbn<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Otbn<'a>

Source

pub fn new(base: StaticRef<OtbnRegisters>) -> Self

Source

pub fn handle_interrupt(&self)

Source

pub fn set_client(&'a self, client: &'a dyn Client<'a>)

Set the client instance which will receive

Source

pub fn load_binary(&self, input: &[u8]) -> Result<(), ErrorCode>

Load the acceleration binary data into the accelerator. This data will be accelerator specific and could be an elf file which will be run or could be binary settings used to configure the accelerator. This function can be called multiple times if multiple binary blobs are required. On error the return value will contain a return code and the original data

Source

pub fn load_data(&self, address: usize, data: &[u8]) -> Result<(), ErrorCode>

Load the data into the accelerator This function can be called multiple times if multiple loads are required. On error the return value will contain a return code and the original data The data buffer should be in little endian

Source

pub fn run( &self, address: usize, output: &'static mut [u8], ) -> Result<(), (ErrorCode, &'static mut [u8])>

Run the acceleration operation. This doesn’t return any data, instead the client needs to have set a op_done handler to determine when this is complete.

The data returned via op_done() will be starting at address and of the full length of output.

On error the return value will contain a return code and the original data If there is data from the load_binary() command asyncrously waiting to be written it will be written before the operation starts.

Source

pub fn clear_data(&self)

Clear the keys and any other sensitive data. This won’t clear the buffers provided to this API, that is up to the user to clear those.

Auto Trait Implementations§

§

impl<'a> !Freeze for Otbn<'a>

§

impl<'a> !RefUnwindSafe for Otbn<'a>

§

impl<'a> !Send for Otbn<'a>

§

impl<'a> !Sync for Otbn<'a>

§

impl<'a> Unpin for Otbn<'a>

§

impl<'a> !UnwindSafe for Otbn<'a>

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.