crypto_rng_get_bytes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– crypto_rng_get_bytes(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” today's main character is crypto_rng_get_bytes, aka the little function that hands you random numbers. no cap, it's giving "glow-up for your buffer" ✨


🌸 NAME 🌸

crypto_rng_get_bytes β€” get random number. that's it. that's the whole vibe. 🎲


✨ SYNOPSIS ✨

int crypto_rng_get_bytes (struct crypto_rng *tfm , u8 *rdata , unsigned
int dlen );

like, it returns an int, and it takes three lil friends. slay πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • tfm β€” the cipher handle 🫢 literally the RNG's whole identity, hold it gently.
  • rdata β€” your output buffer, and yes it's where the random numbers go to live their best life.
  • dlen β€” the length of that output buffer. please tell it the truth, it needs to know 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” this function fills the caller-allocated buffer with random numbers, using the random number generator that the cipher handle (tfm) is referencing. you bring the buffer, it brings the chaos. iconic partnership honestly. πŸ”₯

bestie note: caller-allocated means YOU made the buffer. it's not gonna do it for you. no free rides, only free random bytes. πŸ’€

⭐ RETURN ⭐

  • 0 β€” function was successful, we ate and left no crumbs πŸ‘‘
  • < 0 β€” an error occurred 😭 vibe check failed, go read the error code

🌈 SEE ALSO 🌈

iykyk β€” go read them all, they're the friend group πŸ’œ


and that's the whole page, bestie πŸ’– this one came from ./include/crypto, dated October 2026 β€” so go forth, fill your buffers with randomness, and remember: stay random, stay iconic πŸ§šβ€β™€οΈπŸŒΈβœ¨

πŸ“¦ where this page comes from