Trait mavio::protocol::Sign

source ·
pub trait Sign {
    // Required methods
    fn reset(&mut self);
    fn digest(&mut self, bytes: &[u8]);
    fn produce(&self) -> SignatureValue;
}
Expand description

Interface for MAVLink 2 frames signing algorithm.

An implementor of Sign should be capable to calculate sha256_48, a MAVLink 2 specific hashing algorithm similar to regular sha256 except that only first 48 bits are considered.

Required Methods§

source

fn reset(&mut self)

Reset inner state of a signer.

Used by caller to ensure that signer’s inner state does not have any digested data.

source

fn digest(&mut self, bytes: &[u8])

Adds value to digest.

Caller can invoke Sign::digest multiple times. Passing data as several sequential chunks is the same as calling digest with the whole data at once.

source

fn produce(&self) -> SignatureValue

Produces MAVLink 2 signature from the internal state.

Implementors§