Module dryoc::generichash::protected
source · Available on crate feature
nightly
only.Expand description
Protected memory type aliases for GenericHash
This mod provides re-exports of type aliases for protected memory usage
with GenericHash
. These type aliases are provided for
convenience.
Example
use base64::encode;
use dryoc::generichash::protected::*;
use dryoc::generichash::GenericHash;
// Create a randomly generated key, lock it, protect it as read-only
let key = Key::gen_readonly_locked().expect("gen failed");
let input =
HeapBytes::from_slice_into_readonly_locked(b"super secret input").expect("input failed");
let hash: Locked<Hash> = GenericHash::hash(&input, Some(&key)).expect("hash failed");