Trait kernel::hil::digest::ClientVerify

source ·
pub trait ClientVerify<const L: usize> {
    // Required method
    fn verification_done(
        &self,
        result: Result<bool, ErrorCode>,
        compare: &'static mut [u8; L]
    );
}
Expand description

Implement this trait and use set_client() in order to receive callbacks when digest verification is complete.

‘L’ is the length of the ‘u8’ array to store the digest output.

Required Methods§

source

fn verification_done( &self, result: Result<bool, ErrorCode>, compare: &'static mut [u8; L] )

Called when a verification is computed. compare is the reference supplied to verify() and the data stored in compare is unchanged. On Ok the bool indicates if the computed hash matches the value in compare. Valid ErrorCode values are:

  • OFF: the underlying digest engine is powered down and cannot be used.
  • BUSY: there is an outstanding add_data, add_data_mut, run, or verify operation, so the digest engine is busy and cannot verify a hash.
  • CANCEL: the operation was cancelled by a call to clear_data.
  • NOSUPPORT: the requested digest algorithm is not supported, or one was not requested.
  • FAIL: an internal failure.

Implementors§