-
Notifications
You must be signed in to change notification settings - Fork 985
blake2b avx2 impl #2667
Description
Have looked around and found avx2 code impl that we can reuse: https://github.com/oconnor663/blake2_simd/blob/82b3e2aee4d2384aabbeb146058301ff0dbd453f/blake2b/src/avx2.rs#L146-L424
And it should replace this fn
revm/crates/precompile/src/blake2.rs
Line 104 in 8032618
| pub fn compress(rounds: usize, h: &mut [u64; 8], m: [u64; 16], t: [u64; 2], f: bool) { |
There are few modification that needs to be done. Eth precompile has N round so we need to check if round counter has expired or not more often. Inputs that I can deduce areblock is m, words is h, count is t.last_block looks like a mask for f but not sure what last_node is.
This algorithm aligns with what Nethermind has https://github.com/NethermindEth/nethermind/blob/cc953a1e1375d1d8133b92655211597336709412/src/Nethermind/Nethermind.Crypto/Blake2/Blake2Avx2.cs#L48-L697