Skip to main content

Module backend

Module backend 

Expand description

Cryptographic backend abstraction for KDF and MAC operations.

Provides unified API for key derivation and message authentication, with compile-time selection between:

  • Default: Blake3 (fast, modern, ~10+ GB/s with SIMD)
  • FIPS mode: HKDF-SHA256 + HMAC-SHA256 (NIST-approved)

§Feature Flags

  • Default: Blake3 derive_key() and keyed_hash()
  • fips: HKDF-SHA256 (SP 800-56C) and HMAC-SHA256 (FIPS 198-1)

Functions§

derive_key
Derive a 32-byte key from input material with domain separation.
keyed_mac
Compute a 32-byte keyed MAC.
keyed_mac_truncated
Compute a 16-byte truncated keyed MAC (for wire format).
keyed_mac_truncated_parts
Multi-part variant of keyed_mac_truncated — authenticates the concatenation of parts without allocating a joined buffer.