Skip to main content

seal_file_key

Function seal_file_key 

Source
pub fn seal_file_key(amk: &Amk, file_id: &Uuid, file_key: &[u8; 32]) -> Vec<u8> ⓘ
Expand description

Seal an externally-chosen 32-byte file key K under amk, scoped to file_id.

Draws a fresh wrap_nonce, derives the wrap key with the nonce folded into the salt, and returns wrap_nonce ‖ AES-256-GCM(K) ‖ tag — the bytes stored verbatim in the manifest’s wrapped_file_key. Wrap key derivation is deferred to the AMK so nonce generation and derivation stay coupled (the salt depends on the nonce).