Skip to main content

signed_bytes

Function signed_bytes 

Source
pub fn signed_bytes(
    handshake_hash: &[u8],
    genesis: &[u8; 32],
    ts: u64,
    node_id: &str,
    platform: &str,
    capabilities: &[String],
) -> Vec<u8> ⓘ
Expand description

The exact bytes a hello signs.

Layout: domain || handshake hash || genesis || ts (BE) || node_id || platform || capability count (BE u32) || each capability, with every variable-length string prefixed by its length (BE u32). Covering the identity, platform and capabilities means none can be altered in flight; the class a hello implies is therefore signed (but still self-declared, see VerifiedHello::class).