Skip to main content

Module format

Module format 

Source
Expand description

Module format definition and serialization

The Speck module format is designed for:

  • Compact representation (minimal overhead)
  • Streaming parsing (no heap required for verification)
  • Position independence (runtime relocatable)
  • Extensibility (flags and reserved fields)

Re-exports§

pub use header::ModuleHeader;
pub use header::HeaderFlags;
pub use manifest::ModuleManifest;

Modules§

header
Module header definitions
manifest
Module manifest for metadata and dependencies

Structs§

Module
Complete module structure
ModuleBuilder
Builder for constructing modules
SignedModuleBuilder
Intermediate builder for signed modules

Constants§

FIXED_HEADER_SIZE
Size of fixed header (everything except code)
FLAG_COMPRESSED
Flag: Code is compressed (gzip)
FLAG_CRITICAL
Flag: Critical update (cannot be skipped)
FLAG_HW_LOCKED
Flag: Module requires specific hardware revision
FLAG_SIGNED
Flag: Module is signed
MAGIC
Magic number for Speck modules: “SPK\x02” (version 2)
MAX_CODE_SIZE
Maximum supported code size (1MB to fit in 20-bit offsets)