pub trait SignatureVerify<'a, const HL: usize, const SL: usize> {
// Required methods
fn set_verify_client(&self, client: &'a dyn ClientVerify<HL, SL>);
fn verify(
&self,
hash: &'static mut [u8; HL],
signature: &'static mut [u8; SL],
) -> Result<(), (ErrorCode, &'static mut [u8; HL], &'static mut [u8; SL])>;
}
Expand description
Verify a signature.
This is a generic interface, and it is up to the implementation as to the signature verification algorithm being used.
HL
: The length in bytes of the hash.SL
: The length in bytes of the signature.
Required Methods§
Sourcefn set_verify_client(&self, client: &'a dyn ClientVerify<HL, SL>)
fn set_verify_client(&self, client: &'a dyn ClientVerify<HL, SL>)
Set the client instance which will receive the verification_done()
callback.
Sourcefn verify(
&self,
hash: &'static mut [u8; HL],
signature: &'static mut [u8; SL],
) -> Result<(), (ErrorCode, &'static mut [u8; HL], &'static mut [u8; SL])>
fn verify( &self, hash: &'static mut [u8; HL], signature: &'static mut [u8; SL], ) -> Result<(), (ErrorCode, &'static mut [u8; HL], &'static mut [u8; SL])>
Verify the signature matches the given hash.
If this returns Ok(())
, then the verification_done()
callback will
be called. If this returns Err()
, no callback will be called.
The valid ErrorCode
s that can occur are:
OFF
: the underlying digest engine is powered down and cannot be used.BUSY
: there is an outstanding operation already in process, and the verification engine cannot accept another request.