pub trait SignatureSign<'a, const HL: usize, const SL: usize> {
// Required methods
fn set_sign_client(&self, client: &'a dyn ClientSign<HL, SL>);
fn sign(
&self,
hash: &'static mut [u8; HL],
signature: &'static mut [u8; SL],
) -> Result<(), (ErrorCode, &'static mut [u8; HL], &'static mut [u8; SL])>;
}
Expand description
Sign a message.
This is a generic interface, and it is up to the implementation as to the signing algorithm being used.
HL
: The length in bytes of the hash.SL
: The length in bytes of the signature.
Required Methods§
Sourcefn set_sign_client(&self, client: &'a dyn ClientSign<HL, SL>)
fn set_sign_client(&self, client: &'a dyn ClientSign<HL, SL>)
Set the client instance which will receive the signing_done()
callback.
Sourcefn sign(
&self,
hash: &'static mut [u8; HL],
signature: &'static mut [u8; SL],
) -> Result<(), (ErrorCode, &'static mut [u8; HL], &'static mut [u8; SL])>
fn sign( &self, hash: &'static mut [u8; HL], signature: &'static mut [u8; SL], ) -> Result<(), (ErrorCode, &'static mut [u8; HL], &'static mut [u8; SL])>
Sign the given hash.
If this returns Ok(())
, then the signing_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 signing engine cannot accept another request.