mpz
mpz copied to clipboard
CSPRG comparison
Recently we added a PRG based on AES-128 in counter-mode, which should be quite performant due to hardware acceleration. However, there was not any discussion on the trade-offs compared to using ChaCha(8/12/20).
Local benchmarks on my machine indicate that our new AES PRG has the same performance as rand_chacha::ChaCha8Rng
and is roughly 50% faster than ChaCha12
. I haven't gone looking for figures on which ChaCha variant is most appropriate in terms of security level to compare with AES.
We should also consider the difference for targets without hardware acceleration available (WASM).