Skip to main content

Module kdf

Module kdf 

Source
Expand description

HKDF-SHA512 key derivation (SSoT: Cryptography — Primitives § Key Derivation).

The wider SHA-512 keeps the post-quantum posture (a 256-bit hash falls to ~128-bit under Grover; SHA-512 retains ~256-bit), and KDFs are off the hot path. Every derivation includes a versioned info label (see super::primitives::info) and a scope-unique salt (album_id, file_id, blob_id) — salts are never reused across scopes. The 512-bit output is truncated to 32 bytes for AES-256 keys.

Functions§

derive_key32
Derive a 32-byte (AES-256) key. The canonical derivation for file and metadata-blob keys.
hkdf_sha512
HKDF-SHA512 extract-then-expand, producing out_len bytes.