Skip to main content

SignatureSign

Trait SignatureSign 

Source
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§

Source

fn set_sign_client(&self, client: &'a dyn ClientSign<HL, SL>)

Set the client instance which will receive the signing_done() callback.

Source

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 ErrorCodes 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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§