Module dryoc::pwhash::protected

source ·
Available on crate feature nightly only.
Expand description

Protected memory type aliases for PwHash

This mod provides re-exports of type aliases for protected memory usage with PwHash. These type aliases are provided for convenience.

Example

use dryoc::pwhash::protected::*;
use dryoc::pwhash::{Config, PwHash};

let password = HeapBytes::from_slice_into_locked(
    b"The robb'd that smiles, steals something from the thief.",
)
.expect("couldn't lock password");

let pwhash: LockedPwHash =
    PwHash::hash(&password, Config::interactive()).expect("unable to hash");

pwhash.verify(&password).expect("verification failed");
pwhash
    .verify(b"invalid password")
    .expect_err("verification should have failed");

Re-exports

pub use crate::protected::*;
pub use crate::types::*;

Type Definitions

Heap-allocated, page-aligned hash type alias for protected password hashing with PwHash.
Locked PwHash, provided as a type alias for convenience.
Heap-allocated, page-aligned salt type alias for protected password hashing with PwHash.