Struct capsules_extra::sip_hash::SipHasher24
source · pub struct SipHasher24<'a> { /* private fields */ }
Implementations§
source§impl<'a> SipHasher24<'a>
impl<'a> SipHasher24<'a>
Trait Implementations§
source§impl<'a> DeferredCallClient for SipHasher24<'a>
impl<'a> DeferredCallClient for SipHasher24<'a>
source§impl<'a> Hasher<'a, 8> for SipHasher24<'a>
impl<'a> Hasher<'a, 8> for SipHasher24<'a>
source§fn set_client(&'a self, client: &'a dyn Client<8>)
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>)>
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 moresource§fn add_mut_data(
&self,
data: SubSliceMut<'static, u8>,
) -> Result<usize, (ErrorCode, SubSliceMut<'static, u8>)>
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 moresource§fn run(
&'a self,
digest: &'static mut [u8; 8],
) -> Result<(), (ErrorCode, &'static mut [u8; 8])>
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 moresource§fn clear_data(&self)
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.
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> 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