Files
linux-cryptodev-2.6/crypto
Eric Biggers 52b84667bb crypto: rng - Add crypto_stdrng_get_bytes()
All callers of crypto_get_default_rng() use the following sequence:

    crypto_get_default_rng()
    crypto_rng_get_bytes(crypto_default_rng, ...)
    crypto_put_default_rng()

While it may have been intended that callers amortize the cost of
getting and putting the "default RNG" (i.e. "stdrng") over multiple
calls, in practice that optimization is never used.  The callers just
want a function that gets random bytes from the "stdrng".

Therefore, add such a function: crypto_stdrng_get_bytes().

Importantly, this decouples the callers from the crypto_rng API.  That
allows a later commit to make this function simply call
get_random_bytes_wait() unless the kernel is in "FIPS mode".

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2026-04-03 08:56:11 +08:00
..
2024-04-02 10:49:38 +08:00
2025-06-11 10:59:45 +08:00
2025-05-19 13:48:20 +08:00
2026-01-05 16:43:36 +01:00
2026-01-21 22:32:50 +00:00
2026-01-05 16:43:36 +01:00
2024-04-02 10:49:38 +08:00
2024-08-02 20:53:25 +08:00