Skip to main content

Module protected

Module protected 

Source
Available on crate feature protected only.
Expand description

§Protected memory type aliases for DryocSealedBox

use dryoc::dryocsealedbox::DryocSealedBox;
use dryoc::dryocsealedbox::protected::*;

let recipient_keypair = LockedROKeyPair::generate_readonly_locked_keypair().expect("keypair");
let message = HeapBytes::from_slice_into_readonly_locked(b"Secret message").expect("message");

let sealed: LockedBox =
    DryocSealedBox::seal(&message, &recipient_keypair.public_key).expect("seal");
let decrypted: LockedBytes = sealed.open(&recipient_keypair).expect("open");
assert_eq!(message.as_slice(), decrypted.as_slice());

Re-exports§

pub use crate::kem::xwing::protected::*;

Type Aliases§

EncapsulatedKey
Heap-allocated X-Wing ciphertext, for use with protected memory.
LockedBox
Locked DryocSealedBox.
Mac
Heap-allocated authentication tag, for use with protected memory.