Skip to main content

Crate speck_core

Crate speck_core 

Source
Expand description

§Speck Core

Runtime package manager for MMU-less microcontrollers.

This crate provides:

  • Secure code signing and verification (Ed25519)
  • Efficient binary delta updates
  • Flash-aware storage with wear leveling
  • Position-independent code module format

§Example

use speck_core::{Module, KeyPair, DeltaBuilder};
 
// Generate signing keys
let keypair = KeyPair::generate();
 
// Create and sign a module
let code = vec![0x55, 0xAA, 0x00, 0x40]; // ARM Thumb code
let module = Module::builder()
    .code(code)
    .entry_offset(0)
    .sign(&keypair)
    .build()
    .expect("valid module");
 
// Verify the module
module.verify().expect("signature valid");

Re-exports§

pub use crypto::KeyPair;
pub use crypto::PublicKey;
pub use crypto::Signature;
pub use delta::Delta;
pub use delta::DeltaApplier;
pub use delta::DeltaBuilder;
pub use error::Error;
pub use error::Result;
pub use flash::Flash;
pub use flash::FlashConfig;
pub use flash::PageId;
pub use format::Module;
pub use format::ModuleBuilder;
pub use format::ModuleHeader;
pub use format::ModuleManifest;
pub use storage::StorageManager;
pub use storage::StorageConfig;
pub use storage::InstallationStatus;

Modules§

crypto
Cryptographic primitives for module signing
delta
Binary delta encoding for efficient updates
error
Error types for Speck operations
flash
NOR Flash abstraction with wear leveling and transaction support
format
Module format definition and serialization
storage
High-level storage management with transactions and wear leveling
util
Utility functions

Constants§

CURRENT_MODULE_VERSION
Current module format version
MIN_MODULE_VERSION
Minimum compatible module format version
VERSION
Library version constant