crypto_rng_reset(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 bytes slen πŸ’€

πŸ¦‹ 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 ⭐

  • 0 if the setting of the key was successful πŸ’–
  • < 0 if an error occurred 😭

πŸ’œ SEE ALSO πŸ’œ


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