pub trait ClientVerify<const DIGEST_LEN: usize> {
// Required method
fn verification_done(
&self,
result: Result<bool, ErrorCode>,
compare: &'static mut [u8; DIGEST_LEN],
);
}Expand description
Implement this trait and use set_client() in order to receive callbacks when
digest verification is complete.
‘DIGEST_LEN’ is the length of the ‘u8’ array to store the digest output.
Required Methods§
Sourcefn verification_done(
&self,
result: Result<bool, ErrorCode>,
compare: &'static mut [u8; DIGEST_LEN],
)
fn verification_done( &self, result: Result<bool, ErrorCode>, compare: &'static mut [u8; DIGEST_LEN], )
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, orverifyoperation, 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.