feat: zeroize
This commit is contained in:
@@ -45,7 +45,11 @@ pub fn require_file_not_exists(path: impl AsRef<Path>) -> XResult<()> {
|
||||
pub fn make_key256_and_nonce() -> (Vec<u8>, Vec<u8>) {
|
||||
let key: [u8; 32] = random();
|
||||
let nonce: [u8; 12] = random();
|
||||
(key.into(), nonce.into())
|
||||
let result = (key.into(), nonce.into());
|
||||
let (mut key, mut nonce) = (key, nonce);
|
||||
key.zeroize();
|
||||
nonce.zeroize();
|
||||
result
|
||||
}
|
||||
|
||||
pub fn simple_kdf(input: &[u8]) -> Vec<u8> {
|
||||
|
||||
Reference in New Issue
Block a user