separate KDF (not a proper KDF for now)

This commit is contained in:
2026-09-24 10:59:02 +02:00
parent cbce59293d
commit 03aee796d8
4 changed files with 74 additions and 18 deletions
+26
View File
@@ -0,0 +1,26 @@
use super::*;
use crate::kdf::kdf::DERIVED_KEY_LEN;
#[test]
fn key_has_expected_length() {
assert_eq!(DERIVED_KEY_LEN, 24);
let key = derive_file_key("test password");
assert_eq!(key.len(), DERIVED_KEY_LEN);
}
#[test]
fn same_password_same_key() {
let a = derive_file_key("correct horse battery staple");
let b = derive_file_key("correct horse battery staple");
assert_eq!(a, b);
}
#[test]
fn different_passwords_produce_different_keys() {
let a = derive_file_key("password1");
let b = derive_file_key("password2");
assert_ne!(a, b);
}