Conversation

Originally I started out with caching the output of getrandom directly, but that's at least an order of magnitude too slow even with the system call cost amortized. Even the current optimized scalar ChaCha8 implementation with highly optimized random range generation is too slow.
1
Replying to and
The chacha.c file is based on the reference implementation of ChaCha, converted into a keystream only implementation by removing the XOR with the message. The random.c file implements the CSPRNG on top of it, which fills a small cache (256 bytes) with the keystream and uses it.
1
1