Re: [linus:master] [lib/crypto] e5046823f8: stress-ng.urandom.ops_per_sec 4.3% regression

Eric Biggers <[email protected]> Wed, 15 Apr 2026 10:47:55 -0700
Newsgroups dev.linux.lists.oe-lkp,org.kernel.vger.linux-crypto
Message-ID <20260415174755.GB3142@quark>
[+Cc Jason and Ted]

On Wed, Apr 15, 2026 at 04:45:48PM +0800, kernel test robot wrote:
> 
> 
> Hello,
> 
> kernel test robot noticed a 4.3% regression of stress-ng.urandom.ops_per_sec on:
> 
> 
> commit: e5046823f8fa3677341b541a25af2fcb99a5b1e0 ("lib/crypto: chacha: Zeroize permuted_state before it leaves scope")
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master

This commit fixed the forward secrecy of the RNG, so it needed to go in.

For large RNG requests, we could get most of this performance back by
refactoring the chacha20_block() API to move the allocation of the
temporary state array into the caller.

We could also get much better performance than before by using the
architecture-optimized ChaCha20 code instead of the generic ChaCha20
code.

However, neither would be a simple change.

- Eric