Skip to main content

Module protected

Module protected 

Source
Available on crate feature protected only.
Expand description

§Protected memory type aliases for HMAC

This mod provides protected-memory aliases for HMAC keys and MACs. Use these aliases when key material or authentication tags should live in locked memory.

use dryoc::hmac::HmacSha256;
use dryoc::hmac::protected::*;

let key = HmacSha256Key::generate_readonly_locked().expect("key failed");
let input = HeapBytes::from_slice_into_readonly_locked(b"More matter, with less art.")
    .expect("input failed");
let mac: Locked<HmacSha256Mac> = HmacSha256::compute(key, &input);

Re-exports§

pub use crate::protected::*;

Type Aliases§

HmacSha256Key
Heap-allocated, page-aligned key for HMAC-SHA-256.
HmacSha256Mac
Heap-allocated, page-aligned MAC for HMAC-SHA-256.
HmacSha512Key
Heap-allocated, page-aligned key for HMAC-SHA-512.
HmacSha512Mac
Heap-allocated, page-aligned MAC for HMAC-SHA-512.
HmacSha512256Key
Heap-allocated, page-aligned key for HMAC-SHA-512-256.
HmacSha512256Mac
Heap-allocated, page-aligned MAC for HMAC-SHA-512-256.