refactor: Externalise AES and SEA functions

This commit is contained in:
0xalivecow 2024-10-22 20:22:42 +02:00
parent 3a777cab00
commit 7c94e5d8fb
No known key found for this signature in database
4 changed files with 76 additions and 33 deletions

9
src/utils/math.rs Normal file
View file

@ -0,0 +1,9 @@
use anyhow::Result;
pub fn xor_bytes(vec1: &Vec<u8>, mut vec2: Vec<u8>) -> Result<Vec<u8>> {
for (byte1, byte2) in vec1.iter().zip(vec2.iter_mut()) {
*byte2 ^= byte1;
}
Ok(vec2)
}