tpm1_get_random(9)
πΈ 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β astruct tpm_chipinstance. 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 todest. 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:
tpm1_calc_ordinal_duration(9)tpm1_startup(9)tpm1_continue_selftest(9)tpm1_do_selftest(9)tpm1_auto_startup(9)tpm1_pm_suspend(9)tpm1_get_pcr_allocation(9)
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
- 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