Struct capsules_extra::sha256::Sha256Software

source ·
pub struct Sha256Software<'a> { /* private fields */ }

Implementations§

source§

impl<'a> Sha256Software<'a>

source

pub fn new() -> Self

source

pub fn busy(&self) -> bool

Trait Implementations§

source§

impl<'a> DeferredCallClient for Sha256Software<'a>

source§

fn handle_deferred_call(&self)

Software interrupt function that is called when the deferred call is triggered.
source§

fn register(&'static self)

source§

impl<'a> Digest<'a, 32> for Sha256Software<'a>

source§

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

Set the client instance which will receive hash_done(), add_data_done() and verification_done() callbacks.
source§

impl<'a> DigestData<'a, 32> for Sha256Software<'a>

source§

fn add_data( &self, data: SubSlice<'static, u8>, ) -> Result<(), (ErrorCode, SubSlice<'static, u8>)>

Add data to the input of the hash function/digest. Ok indicates all of the active bytes in data will be added. There is no guarantee the data has been added to the digest until the add_data_done() callback is called. On error the cause of the error is returned along with the SubSlice unchanged (it has the same range of active bytes as the call). Valid ErrorCode values are: Read more
source§

fn add_mut_data( &self, data: SubSliceMut<'static, u8>, ) -> Result<(), (ErrorCode, SubSliceMut<'static, u8>)>

Add data to the input of the hash function/digest. Ok indicates all of the active bytes in data will be added. There is no guarantee the data has been added to the digest until the add_mut_data_done() callback is called. On error the cause of the error is returned along with the SubSlice unchanged (it has the same range of active bytes as the call). Valid ErrorCode values are: Read more
source§

fn clear_data(&self)

Clear the keys and any other internal state. Any pending operations terminate and issue a callback with an ErrorCode::CANCEL. This call does not clear buffers passed through add_mut_data, those are up to the client clear.
source§

fn set_data_client(&'a self, _client: &'a (dyn ClientData<32> + 'a))

Set the client instance which will handle the add_data_done and add_mut_data_done callbacks.
source§

impl<'a> DigestDataHash<'a, 32> for Sha256Software<'a>

source§

fn set_client(&'a self, _client: &'a dyn ClientDataHash<32>)

Set the client instance which will receive hash_done() and add_data_done() callbacks.
source§

impl<'a> DigestDataVerify<'a, 32> for Sha256Software<'a>

source§

fn set_client(&'a self, _client: &'a dyn ClientDataVerify<32>)

Set the client instance which will receive verify_done() and add_data_done() callbacks.
source§

impl<'a> DigestHash<'a, 32> for Sha256Software<'a>

source§

fn run( &'a self, digest: &'static mut [u8; 32], ) -> Result<(), (ErrorCode, &'static mut [u8; 32])>

Compute a digest of all of the data added with add_data and add_data_mut, storing the computed value in digest. The computed value is returned in a hash_done callback. On error the return value will contain a return code and the slice passed in digest. Valid ErrorCode values are: Read more
source§

fn set_hash_client(&'a self, _client: &'a (dyn ClientHash<32> + 'a))

Set the client instance which will receive the hash_done() callback.
source§

impl<'a> DigestVerify<'a, 32> for Sha256Software<'a>

source§

fn verify( &'a self, compare: &'static mut [u8; 32], ) -> Result<(), (ErrorCode, &'static mut [u8; 32])>

Compute a digest of all of the data added with add_data and add_data_mut then compare it with value in compare. The compare value is returned in a verification_done callback, along with a boolean indicating whether it matches the computed value. On error the return value will contain a return code and the slice passed in compare. Valid ErrorCode values are: Read more
source§

fn set_verify_client(&'a self, _client: &'a (dyn ClientVerify<32> + 'a))

Set the client instance which will receive the verification_done() callback.
source§

impl Sha256 for Sha256Software<'_>

source§

fn set_mode_sha256(&self) -> Result<(), ErrorCode>

Call before adding data to perform Sha256

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<'a> Unpin for Sha256Software<'a>

§

impl<'a> !UnwindSafe for Sha256Software<'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>,

§

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>,

§

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.