KCAPI_RNG_INIT(3)

✨ NAME ✨

kcapi_rng_init β€” bestie, this is the one that gets your cipher handle initialized, okurrr πŸ’…

It's from the Programming Interface manual, section 3, and honestly? iconic behavior.


🌸 SYNOPSIS 🌸

int kcapi_rng_init(struct kcapi_handle ** handle,
                   const char * ciphername, uint32_t flags);

πŸŽ€ ARGUMENTS πŸŽ€

  • handle β€” [out] the cipher handle that gets filled up during the call. yes bestie, this one's the output, she's giving main character energy and she's coming back to you 🫢
  • ciphername β€” [in] the kernel crypto API cipher name, exactly as it's specified in /proc/crypto. not vibes-based, actual file, actual name, no cap πŸ¦‹
  • flags β€” [in] flags that specify the type of cipher handle. for RNG this one is literally unused, she's just here for the plot πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

Okay so, this function initializes a random number generator handle and β€” the important part β€” establishes the connection to the kernel πŸ”₯ That's the whole thing. That's the vibe check. RNG handle, connected, done.

On success, a pointer to a kcapi_handle object is returned in *handle. So like, you get your handle back through that pointer. πŸ’«

After that, you should call kcapi_rng_destroy to free the resources. Not me forgetting to clean up... don't be that girl. kcapi_rng_destroy afterwards, periodt. πŸ‘‘

And here's the return situation, so you know exactly what you're getting:

  • returns 0 upon success β€” slay ✨
  • -ENOENT β€” algorithm not available 😭
  • -EOPNOTSUPP β€” the AF_ALG family is not available πŸ’€
  • -EINVAL β€” the accept syscall failed
  • -ENOMEM β€” the cipher handle cannot be allocated πŸ™ˆ

🌈 AUTHOR 🌈

Stephan Mueller <smueller@chronox.de> β€” the author. king behavior fr fr πŸ‘‘



And that's the whole page, bestie πŸŽ€ just so you know where you are: this is libkcapi Manual 1.5.0, from July 2025 β€” KCAPI_RNG_INIT(3) β€” go forth and initialize responsibly, ily πŸŒΈπŸ¦‹πŸ’–

πŸ“¦ where this page comes from