let network = key
.chunks_exact(4)
.map(|chunk| {
move |half: &XorArray<u8, ConstArrayLength<32>>| {
let mut hasher = Sha256::new();
hasher.update(half);
hasher.update(chunk);
let value: [u8; 32] = hasher.finalize().into();
XorArray(value.into())
}
})
.feistel_symmetric();
let original = [0; 64].into();
let encrypted = network.clone().array_encrypt(original);
assert_ne!(original, encrypted);
let decrypted = network.clone().array_decrypt(encrypted);
assert_eq!(original, decrypted);
-
Notifications
You must be signed in to change notification settings - Fork 0
License
Apache-2.0, MIT licenses found
Licenses found
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
parrrate/feistel
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Apache-2.0, MIT licenses found
Licenses found
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published