Module protected

Source
Available on crate feature nightly only.
Expand description

§Protected memory for SigningKeyPair and SignedMessage.

§Example

use dryoc::sign::SigningKeyPair;
use dryoc::sign::protected::*;

// Generate a random keypair, using default types
let keypair = SigningKeyPair::gen_locked_keypair().expect("keypair gen failed");
let message = Message::from_slice_into_locked(
    b"Fair is foul, and foul is fair: Hover through the fog and filthy air.",
)
.expect("message lock failed");

// Sign the message, using default types (stack-allocated byte array, Vec<u8>)
let signed_message: LockedSignedMessage = keypair.sign(message).expect("signing failed");

// Verify the message signature
signed_message
    .verify(&keypair.public_key)
    .expect("verification failed");

Re-exports§

pub use crate::protected::*;

Type Aliases§

LockedSignedMessage
Heap-allocated, page-aligned signed message, for use with protected memory.
LockedSigningKeyPair
Heap-allocated, page-aligned public/secret keypair for message signing, for use with protected memory.
Message
Heap-allocated, page-aligned message for signed messages, for use with protected memory.
PublicKey
Heap-allocated, page-aligned public-key for signed messages, for use with protected memory.
SecretKey
Heap-allocated, page-aligned secret-key for signed messages, for use with protected memory.
Signature
Heap-allocated, page-aligned signature for signed messages, for use with protected memory.