Skip to main content

Module protected

Module protected 

Source
Available on crate feature protected only.
Expand description

§Protected memory type aliases for Auth

Protected-memory aliases for authentication keys and codes.

§Example

use dryoc::auth::Auth;
use dryoc::auth::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. This takes ownership of the key.
let mac: Locked<Mac> = Auth::compute(key, &input);

Re-exports§

pub use crate::protected::*;

Type Aliases§

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