Crates.io | seckey |
lib.rs | seckey |
version | 0.12.1 |
source | src |
created_at | 2016-08-30 07:40:15.560555 |
updated_at | 2023-03-01 09:37:01.882013 |
description | Use `memsec` protected secret memory. |
homepage | |
repository | https://github.com/quininer/seckey |
max_upload_size | |
id | 6182 |
size | 18,775 |
Use memsec protected secret memory.
use seckey::SecBytes;
let mut secpass = SecBytes::with(1, |buf| buf.copy_from_slice(&[8; 8][..]));
{
assert_eq!([8u8; 8], *secpass.read());
}
{
let mut wpass = secpass.write();
wpass[0] = 0;
assert_eq!([0, 8, 8, 8, 8, 8, 8, 8], *wpass);
}