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 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");
Re-exports
Type Definitions
- Heap-allocated, page-aligned hash output for the generic hash algorithm, for use with protected memory.
- Heap-allocated, page-aligned secret key for the generic hash algorithm, for use with protected memory.