tpm1_get_random(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

Okay bestie, gather ’round: this is tpm1_get_random, straight out of the Kernel API Manual β€” section (9) energy ✨. It’s literally the function that gets random bytes from the TPM's RNG. No cap, that’s the whole name vibe. πŸŽ€


✨ SYNOPSIS ✨

int tpm1_get_random (struct tpm_chip *chip , u8 *dest , size_t max );

πŸŽ€ ARGUMENTS πŸŽ€

Here’s the cast β€” three little parameters doing main character work:

  • chip β€” a struct tpm_chip instance. That’s the TPM chip bestie in question. πŸ’–
  • dest β€” destination buffer for the random bytes. This is where the random goodness lands. ✨
  • max β€” the maximum number of bytes to write to dest. Respect the limit, periodt. πŸ’…

πŸ’… RETURN πŸ’…

The return value is giving two possible moods:

  • number of bytes read 🌈
  • -errno (positive TPM return codes are masked to -EIO) 😭

πŸ¦‹ SEE ALSO πŸ¦‹

The Kernel file is ./drivers/char/tpm/tpm1-cmd.c, and these are the linked besties you should also check out:


Cute sign-off time πŸ’–: this page comes from the source path ./drivers/char/tpm, dated October 2026 β€” stay random, bestie, and hydrate! πŸ¦‹πŸ’…βœ¨

πŸ“¦ where this page comes from