krypteia-memory 0.1.0

TLSF-based memory allocator for the krypteia cryptographic workspace, configurable between platform malloc/free (os-alloc) and a self-managed heap over a caller-provided RAM block (self-alloc) for embedded targets.
Documentation
  • Coverage
  • 100%
    7 out of 7 items documented0 out of 0 items with examples
  • Size
  • Source code size: 43.16 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 313.21 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 6s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • cslashm

krypteia-memory — TLSF allocator for the krypteia workspace

Crates.io Docs.rs License: Apache-2.0

Memory allocator for the krypteia cryptographic workspace, configurable between two backends:

  • os-alloc (default) — forward alloc / dealloc to the platform malloc / free. Initialisation is a no-op. Suitable for hosted targets (Linux, macOS, Windows) where the C runtime is already there.
  • self-alloc — a TLSF (Two-Level Segregated Fit) allocator running over a caller- provided RAM block. Single-init, no std, no OsRng, predictable O(1) alloc / dealloc. Suitable for bare-metal targets (STM32 M0 / M4 / M33, ESP32-C3 RISC-V) where no OS heap exists and crypto allocations need to come from a known, bounded region.

Cargo features

Feature Default Effect
os-alloc yes Use the platform malloc/free. Init is a no-op.
self-alloc no TLSF allocator over a caller-provided RAM block (no_std).
global-alloc no Implies self-alloc and registers as #[global_allocator] for FFI consumers (arcana_ffi, quantica_ffi).

Enable exactly one allocator backend per build. os-alloc is the default; self-alloc and global-alloc are mutually exclusive with it.

Usage from C (bare-metal)

#include "krypteia.h"

static uint8_t heap[8192];

int main(void) {
    krypteia_init(heap, sizeof(heap));
    // ... use arcana or quantica APIs ...
}

License

Apache-2.0