1Tspi_TPM_GetRandom(3) Library Functions Manual Tspi_TPM_GetRandom(3)
2
3
4
5 TCG Software Stack Developer's Reference
6
8 Tspi_TPM_GetRandom - generate a random number on the TPM
9
11 #include <tss/platform.h>
12 #include <tss/tcpa_defines.h>
13 #include <tss/tcpa_typedef.h>
14 #include <tss/tcpa_struct.h>
15 #include <tss/tss_typedef.h>
16 #include <tss/tss_structs.h>
17 #include <tss/tspi.h>
18
19 TSS_RESULT Tspi_TPM_GetRandom(TSS_HTPM hTPM, UINT32 size, BYTE** random);
20
21
23 Tspi_TPM_GetRandom gets a good random number for the purpose of gener‐
24 ating symmetric keys, nonces, or seeding a random number generator.
25
26
28 hTPM
29 The hTPM parameter is used to specify the handle of the TPM object. The
30 command to get the TPM to test itself will be sent here.
31
32 size
33 The size parameter is the number of random bytes requested.
34
35 random
36 The random parameter is a pointer to memory containing the random data.
37 This is where the generated number goes. Because this internally allo‐
38 cates memory, Tspi_Context_FreeMemory should also be used.
39
40
42 Tspi_TPM_GetRandom returns TSS_SUCCESS on success, otherwise one of the
43 following values is returned:
44
45 TSS_E_INVALID_HANDLE
46 hTPM is not a valid handle.
47
48
49 TSS_E_INTERNAL_ERROR
50 An internal SW error has been detected.
51
52
53 TSS_E_BAD_PARAMETER
54 One or more parameters is bad.
55
56
58 Tspi_TPM_GetRandom conforms to the Trusted Computing Group Software
59 Specification version 1.1 Golden
60
61
63 Tspi_Context_FreeMemory(3).
64
65
66
67
68TSS 1.1 2004-05-25 Tspi_TPM_GetRandom(3)