Available on crate feature
nightly
only.Expand description
Protected memory type aliases for Auth
This mod provides re-exports of type aliases for protected memory usage
with Auth
. These type aliases are provided for
convenience.
Example
use dryoc::auth::protected::*;
use dryoc::auth::Auth;
// 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");
// Compute the message authentication code, consuming the key.
let mac: Locked<Mac> = Auth::compute(key, &input);
Re-exports
Type Definitions
- Heap-allocated, page-aligned secret key for the generic hash algorithm, for use with protected memory.
- Heap-allocated, page-aligned hash output for the generic hash algorithm, for use with protected memory.