refactor: Externalise AES and SEA functions
This commit is contained in:
parent
3a777cab00
commit
7c94e5d8fb
4 changed files with 76 additions and 33 deletions
9
src/utils/math.rs
Normal file
9
src/utils/math.rs
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue