feat: works

This commit is contained in:
2023-10-22 00:42:30 +08:00
parent 745b192c20
commit 71b8f75417
7 changed files with 427 additions and 481 deletions

10
src/stream_util.rs Normal file
View File

@@ -0,0 +1,10 @@
use crate::chacha20::ChaCha20;
use crate::simdty::Simd4;
pub(crate) fn next_chacha20_xor(chacha20: &mut ChaCha20, buf: &mut [Simd4<u32>; 4]) {
let block = chacha20.next();
buf[0] = buf[0] ^ block[0];
buf[1] = buf[1] ^ block[1];
buf[2] = buf[2] ^ block[2];
buf[3] = buf[3] ^ block[3];
}