capsules_extra::sip_hash

Struct SipHasher24

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

Implementations§

Source§

impl SipHasher24<'_>

Source

pub fn new() -> Self

Source

pub fn new_with_keys(k0: u64, k1: u64) -> Self

Trait Implementations§

Source§

impl DeferredCallClient for SipHasher24<'_>

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> Hasher<'a, 8> for SipHasher24<'a>

Source§

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

Set the client instance which will receive hash_done() and add_data_done() callbacks. This callback is called when the data has been added to the hash engine. The callback should follow the Client add_data_done callback.
Source§

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

Add data to the hash block. This is the data that will be used for the hash function. Returns the number of bytes parsed on success There is no guarantee the data has been written until the add_data_done() callback is fired. On error the return value will contain a return code and the original data The possible ErrorCodes are: Read more
Source§

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

Add data to the hash block. This is the data that will be used for the hash function. Returns the number of bytes parsed on success There is no guarantee the data has been written until the add_data_done() callback is fired. On error the return value will contain a return code and the original data The possible ErrorCodes are: Read more
Source§

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

Request the implementation to generate a hash and stores the returned hash in the memory location specified. This doesn’t return any data, instead the client needs to have set a hash_done handler to determine when this is complete. On error the return value will contain a return code and the original data If there is data from the add_data() command asyncrously waiting to be written it will be written before the operation starts. The possible ErrorCodes are: Read more
Source§

fn clear_data(&self)

Clear the internal state of the engine. This won’t clear the buffers provided to this API, that is up to the user to clear.
Source§

impl SipHash for SipHasher24<'_>

Source§

fn set_keys(&self, k0: u64, k1: u64) -> Result<(), ErrorCode>

Optionaly call before Hasher::run() to specify the keys used The possible ErrorCodes are: Read more

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<'a> Unpin for SipHasher24<'a>

§

impl<'a> !UnwindSafe for SipHasher24<'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.