crypto_rng_reset(9)
β¨ NAME β¨
crypto_rng_reset β okay so this is the one that re-initializes the RNG, and yes bestie, we're in the Kernel API Manual (section 9, kernel API pages, as you can prob guess from the (9)) π
πΈ SYNOPSIS πΈ
int crypto_rng_reset (struct crypto_rng *tfm , const u8 *seed , unsigned
int slen );
π ARGUMENTS π
tfmβ the cipher handle. that's the RNG you're messing with, she's the main character here πseedβ the seed input data. your lil starter pack of entropy πslenβ the length of the seed input data. yes, somebody has to count the bytesslenπ
π¦ DESCRIPTION π¦
So like, the reset function completely re-initializes the random number generator that's referenced by the cipher handle β and the way it does that is by clearing the current state. gone. poof. β¨
Then the new state gets initialized either with the seed that the caller provided, or automatically β it lowkey depends on the random number generator type, iykyk. (Fun fact: the SP800-90A DRBGs perform an automatic seeding. so those ones just handle it themselves, no cap.)
The seed is provided as a parameter to this function call. and here's the part where you gotta pay attention bestie: the provided seed should have the length of the seed size defined for the random number generator, as defined by crypto_rng_seedsize. so like, check that before you send it, fr fr π
β RETURN β
0if the setting of the key was successful π< 0if an error occurred π
π SEE ALSO π
- Kernel file
./include/crypto/rng.hstruct rng_alg(9) crypto_stdrng_get_bytes(9)Random number generator API(9)crypto_alloc_rng(9)crypto_rng_alg(9)crypto_free_rng(9)crypto_rng_generate(9)crypto_rng_get_bytes(9)crypto_rng_seedsize(9)
and that's the whole page, bestie β go forth and reset some RNGs responsibly π«Ά
this lil masterpiece lives in ./include/crypto, dated October 2026, and it goes by crypto_rng_reset(9) β slay π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms