Skip to main content

Hmac

Struct Hmac 

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

Implementations§

Source§

impl Hmac<'_>

Source

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

Source

pub fn handle_interrupt(&self)

Trait Implementations§

Source§

impl<'a> Digest<'a, 32> for Hmac<'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 Hmac<'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. 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. Read more
Source§

fn clear_data(&self)

Clear the keys and any other internal state. Read more
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> DigestHash<'a, 32> for Hmac<'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. 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 Hmac<'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. 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 HmacMd5 for Hmac<'_>

Source§

fn set_mode_hmacmd5(&self, _key: &[u8]) -> Result<(), ErrorCode>

Call before adding data to perform HMACMd5 Read more
Source§

impl HmacSha1 for Hmac<'_>

Source§

fn set_mode_hmacsha1(&self, _key: &[u8]) -> Result<(), ErrorCode>

Call before adding data to perform HMACSha1 Read more
Source§

impl HmacSha224 for Hmac<'_>

Source§

fn set_mode_hmacsha224(&self, _key: &[u8]) -> Result<(), ErrorCode>

Call before adding data to perform HMACSha224 Read more
Source§

impl HmacSha256 for Hmac<'_>

Source§

fn set_mode_hmacsha256(&self, key: &[u8]) -> Result<(), ErrorCode>

Call before adding data to perform HMACSha256 Read more
Source§

impl HmacSha384 for Hmac<'_>

Source§

fn set_mode_hmacsha384(&self, _key: &[u8]) -> Result<(), ErrorCode>

Call before adding data to perform HMACSha384 Read more
Source§

impl HmacSha512 for Hmac<'_>

Source§

fn set_mode_hmacsha512(&self, _key: &[u8]) -> Result<(), ErrorCode>

Call before adding data to perform HMACSha512 Read more
Source§

impl Md5 for Hmac<'_>

Source§

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

Call before adding data to perform Md5
Source§

impl Sha1 for Hmac<'_>

Source§

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

Call before adding data to perform Sha1
Source§

impl Sha224 for Hmac<'_>

Source§

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

Call before adding data to perform Sha224
Source§

impl Sha256 for Hmac<'_>

Source§

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

Call before adding data to perform Sha256
Source§

impl Sha384 for Hmac<'_>

Source§

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

Call before adding data to perform Sha384
Source§

impl Sha512 for Hmac<'_>

Source§

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

Call before adding data to perform Sha512

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<'a> Unpin for Hmac<'a>

§

impl<'a> UnsafeUnpin for Hmac<'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.