Skip to main content

Module protected

Module protected 

Source
Available on crate feature protected only.
Expand description

§Protected memory type aliases for OnetimeAuth

Protected-memory aliases for one-time authentication keys and codes.

§Example

use dryoc::onetimeauth::OnetimeAuth;
use dryoc::onetimeauth::protected::*;

// Create a randomly generated key, lock it, protect it as read-only
let key = Key::generate_readonly_locked().expect("generate 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> = OnetimeAuth::compute(key, &input);

Re-exports§

pub use crate::protected::*;

Type Aliases§

Key
Heap-allocated, page-aligned key for one-time authentication with protected memory.
Mac
Heap-allocated, page-aligned one-time authentication code for use with protected memory.