Module protected

Source
Available on crate feature nightly only.
Expand description

§Protected memory type aliases for Kdf

This mod provides re-exports of type aliases for protected memory usage with Kdf. These type aliases are provided for convenience.

§Example

use base64::Engine as _;
use base64::engine::general_purpose;
use dryoc::kdf::Kdf;
use dryoc::kdf::protected::*;

// Randomly generate a main key and context, using locked memory
let key: LockedKdf = Kdf::gen();
let subkey_id = 0;

let subkey: Locked<Key> = key.derive_subkey(subkey_id).expect("derive failed");
println!(
    "Subkey {}: {}",
    subkey_id,
    general_purpose::STANDARD.encode(&subkey)
);

Re-exports§

pub use crate::protected::*;

Type Aliases§

Context
Heap-allocated, page-aligned context type alias for key derivation with Kdf.
Key
Heap-allocated, page-aligned key type alias for key derivation with Kdf.
LockedKdf
Locked Kdf, provided as a type alias for convenience.