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
ah. I'm looking for a cipher fast enough for a 8051. ChaCha20 is just a little bit too slow... though even making it 2x faster would probably not help. all the 32-bit ops really kill the performance
2
2
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