Tspi_TPM_GetRandom(3)
π Tspi_TPM_GetRandom(3) π
okay bestie, welcome to the TCG Software Stack Developer's Reference β this one's from the TSS 1.1 era of the library functions manual, and she is serving random bytes. no cap. π
β¨ NAME β¨
Tspi_TPM_GetRandom β generate a random number on the TPM π²
πΈ SYNOPSIS πΈ
#include <tss/platform.h>
#include <tss/tcpa_defines.h>
#include <tss/tcpa_typedef.h>
#include <tss/tcpa_struct.h>
#include <tss/tss_typedef.h>
#include <tss/tss_structs.h>
#include <tss/tspi.h>
TSS_RESULT Tspi_TPM_GetRandom(TSS_HTPM hTPM, UINT32 size, BYTE** random);
like, all those includes first, then the one actual call. she's lowkey a lot of headers for one function but that's just the vibe π
π¦ DESCRIPTION π¦
Tspi_TPM_GetRandom gets you a good random number, and she's doing it for the purpose of generating symmetric keys, nonces, or seeding a random number generator. that's literally her whole job. main character energy fr fr β¨
π PARAMETERS π
hTPM
the hTPM parameter is used to specify the handle of the TPM object. and get this β the command to get the TPM to test itself will be sent here. yep, that's what the page says, i don't make the rules π«Ά
size
the size parameter is the number of random bytes requested. tell her how many, she delivers that many. π
random
the random parameter is a pointer to memory containing the random data. this is where the generated number goes. and because this internally allocates memory, Tspi_Context_FreeMemory should also be used. do not forget the free, bestie, that's the whole point π
not me reminding you again: internally allocated memory β Tspi_Context_FreeMemory. it's giving "clean up after yourself." π§
π₯ RETURN CODES π₯
Tspi_TPM_GetRandom returns TSS_SUCCESS on success, otherwise one of the following values is returned:
TSS_E_INVALID_HANDLEβhTPMis not a valid handle. πTSS_E_INTERNAL_ERRORβ an internal SW error has been detected. πTSS_E_BAD_PARAMETERβ one or more parameters is bad. π
π CONFORMING TO π
Tspi_TPM_GetRandom conforms to the Trusted Computing Group Software Specification version 1.1 Golden. iconic. she's certified. β
π SEE ALSO π
and that's the whole page, periodt. π
this was TSS 1.1, dated 2004-05-25 β yeah she's an elder but she ate and left no crumbs. bye bestie, go get your random bytes π¦π
π¦ where this page comes from
- debian bookworm: libtspi-dev 0.3.15-0.3 Β· BSD-3-Clause
- debian trixie: libtspi-dev 0.3.15-0.4 Β· BSD-3-Clause
- epel 10: trousers-devel 0.3.15-11.el10_0 Β· BSD
- epel 9: trousers-devel 0.3.15-5.el9 Β· BSD
- fedora 43: trousers-devel 0.3.15-15.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-15.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-16.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: trousers-devel 0.3.15-16.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: trousers-devel 0.3.15-17.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: trousers-devel 0.3.15-17.fc44 Β· LicenseRef-Callaway-BSD
- nixos 26.05: trousers 0.3.15
- nixpkgs unstable: netbsd-source 11.0
- nixpkgs unstable: trousers 0.3.15
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: trousers-devel 0.3.15-160000.2.2 Β· BSD-3-Clause
- ubuntu jammy: libtspi-dev 0.3.15-0.2 Β· BSD-3-Clause
- ubuntu noble: libtspi-dev 0.3.15-0.3build2 Β· BSD-3-Clause
- ubuntu questing: libtspi-dev 0.3.15-0.4
- ubuntu resolute: libtspi-dev 0.3.15-1 Β· BSD-3-Clause
- ubuntu stonking: libtspi-dev 0.3.15-1ubuntu2 Β· BSD-3-Clause
- Copyright (C) 2004 International Business Machines Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms