pub struct DynamicCodex { /* private fields */ }Expand description
Per-vault randomized involution codex.
Construct with DynamicCodex::new; each call produces an
independent random involution.
Implementations§
Source§impl DynamicCodex
impl DynamicCodex
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Construct a new dynamic codex with a fresh random involution.
§Errors
Returns Error::Internal if the OS
CSPRNG fails.
§Examples
use key_vault::{Codex, DynamicCodex};
let codex = DynamicCodex::new().unwrap();
for byte in 0u8..=255 {
assert_eq!(codex.decode(codex.encode(byte)), byte);
}Trait Implementations§
Source§impl Codex for DynamicCodex
impl Codex for DynamicCodex
Auto Trait Implementations§
impl Freeze for DynamicCodex
impl RefUnwindSafe for DynamicCodex
impl Send for DynamicCodex
impl Sync for DynamicCodex
impl Unpin for DynamicCodex
impl UnsafeUnpin for DynamicCodex
impl UnwindSafe for DynamicCodex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more