Skip to main content

commit_signing_bytes

Function commit_signing_bytes 

Source
pub fn commit_signing_bytes(c: &Commit) -> Result<Vec<u8>, MkitError>
Expand description

Serialize a commit’s fields for signing. SPEC-SIGNING §3.

INCLUDED, in order:

  1. Object prologue: [type=0x03][magic="MKT1"][schema_version=0x01].
  2. tree_hash (32).
  3. parent_count (u32 LE) and parent_hash × parent_count (32 each).
  4. Identity author: [kind:u8][len:u16 LE][payload:len].
  5. message_len (u32 LE) and message bytes.
  6. timestamp (u64 LE).
  7. signer (32).

EXCLUDED: signature, message_hash, content_digest.