1tpm2_zgen2phase(1) General Commands Manual tpm2_zgen2phase(1)
2
3
4
6 tpm2_zgen2phase(1) - Command to enable the TPM to combine data from the
7 other party with the ephemeral key generated in the first phase of
8 two-phase key exchange protocols.
9
11 tpm2_zgen2phase [OPTIONS]
12
14 tpm2_zgen2phase(1) - Command to enable the TPM to combine data from the
15 other party with the ephemeral key generated in the first phase of
16 two-phase key exchange protocols.
17
19 • -c, --key-context=FILE:
20
21 Context object pointing to ECC key. Either a file or a handle num‐
22 ber. See section “Context Object Format”.
23
24 • -p, --key-auth=AUTH:
25
26 The authorization value for the ECC key object.
27
28 • -s, --scheme=ALGORITHM:
29
30 The key exchange scheme. Optional. Valid options are ecdh or sm2.
31
32 • -t, --counter=NATURALNUMBER:
33
34 The commit count to determine the key index to use.
35
36 • --static-public=FILE:
37
38 The static public key input of the other party.
39
40 • --ephemeral-public=FILE:
41
42 The ephemeral public key input of the other party.
43
44 • --output-Z1=FILE
45
46 Specify file path to save the calculated ecdh secret Z1 point.
47
48 • --output-Z2=FILE
49
50 Specify file path to save the calculated ecdh secret Z2 point.
51
52 References
54 Options that take algorithms support “nice-names”.
55
56 There are two major algorithm specification string classes, simple and
57 complex. Only certain algorithms will be accepted by the TPM, based on
58 usage and conditions.
59
60 Simple specifiers
61 These are strings with no additional specification data. When creating
62 objects, non-specified portions of an object are assumed to defaults.
63 You can find the list of known “Simple Specifiers Below”.
64
65 Asymmetric
66 • rsa
67
68 • ecc
69
70 Symmetric
71 • aes
72
73 • camellia
74
75 Hashing Algorithms
76 • sha1
77
78 • sha256
79
80 • sha384
81
82 • sha512
83
84 • sm3_256
85
86 • sha3_256
87
88 • sha3_384
89
90 • sha3_512
91
92 Keyed Hash
93 • hmac
94
95 • xor
96
97 Signing Schemes
98 • rsassa
99
100 • rsapss
101
102 • ecdsa
103
104 • ecdaa
105
106 • ecschnorr
107
108 Asymmetric Encryption Schemes
109 • oaep
110
111 • rsaes
112
113 • ecdh
114
115 Modes
116 • ctr
117
118 • ofb
119
120 • cbc
121
122 • cfb
123
124 • ecb
125
126 Misc
127 • null
128
129 Complex Specifiers
130 Objects, when specified for creation by the TPM, have numerous algo‐
131 rithms to populate in the public data. Things like type, scheme and
132 asymmetric details, key size, etc. Below is the general format for
133 specifying this data: <type>:<scheme>:<symmetric-details>
134
135 Type Specifiers
136 This portion of the complex algorithm specifier is required. The re‐
137 maining scheme and symmetric details will default based on the type
138 specified and the type of the object being created.
139
140 • aes - Default AES: aes128
141
142 • aes128<mode> - 128 bit AES with optional mode (ctr|ofb|cbc|cfb|ecb).
143 If mode is not specified, defaults to null.
144
145 • aes192<mode> - Same as aes128<mode>, except for a 192 bit key size.
146
147 • aes256<mode> - Same as aes128<mode>, except for a 256 bit key size.
148
149 • ecc - Elliptical Curve, defaults to ecc256.
150
151 • ecc192 - 192 bit ECC
152
153 • ecc224 - 224 bit ECC
154
155 • ecc256 - 256 bit ECC
156
157 • ecc384 - 384 bit ECC
158
159 • ecc521 - 521 bit ECC
160
161 • rsa - Default RSA: rsa2048
162
163 • rsa1024 - RSA with 1024 bit keysize.
164
165 • rsa2048 - RSA with 2048 bit keysize.
166
167 • rsa4096 - RSA with 4096 bit keysize.
168
169 Scheme Specifiers
170 Next, is an optional field, it can be skipped.
171
172 Schemes are usually Signing Schemes or Asymmetric Encryption Schemes.
173 Most signing schemes take a hash algorithm directly following the sign‐
174 ing scheme. If the hash algorithm is missing, it defaults to sha256.
175 Some take no arguments, and some take multiple arguments.
176
177 Hash Optional Scheme Specifiers
178 These scheme specifiers are followed by a dash and a valid hash algo‐
179 rithm, For example: oaep-sha256.
180
181 • oaep
182
183 • ecdh
184
185 • rsassa
186
187 • rsapss
188
189 • ecdsa
190
191 • ecschnorr
192
193 Multiple Option Scheme Specifiers
194 This scheme specifier is followed by a count (max size UINT16) then
195 followed by a dash(-) and a valid hash algorithm. * ecdaa For example,
196 ecdaa4-sha256. If no count is specified, it defaults to 4.
197
198 No Option Scheme Specifiers
199 This scheme specifier takes NO arguments. * rsaes
200
201 Symmetric Details Specifiers
202 This field is optional, and defaults based on the type of object being
203 created and it’s attributes. Generally, any valid Symmetric specifier
204 from the Type Specifiers list should work. If not specified, an asym‐
205 metric objects symmetric details defaults to aes128cfb.
206
207 Examples
208 Create an rsa2048 key with an rsaes asymmetric encryption scheme
209 tpm2_create -C parent.ctx -G rsa2048:rsaes -u key.pub -r key.priv
210
211 Create an ecc256 key with an ecdaa signing scheme with a count of 4 and
212 sha384 hash
213 /tpm2_create -C parent.ctx -G ecc256:ecdaa4-sha384 -u key.pub -r
214 key.priv cryptographic algorithms ALGORITHM.
215
217 This collection of options are common to many programs and provide in‐
218 formation that many users may expect.
219
220 • -h, --help=[man|no-man]: Display the tools manpage. By default, it
221 attempts to invoke the manpager for the tool, however, on failure
222 will output a short tool summary. This is the same behavior if the
223 “man” option argument is specified, however if explicit “man” is re‐
224 quested, the tool will provide errors from man on stderr. If the
225 “no-man” option if specified, or the manpager fails, the short op‐
226 tions will be output to stdout.
227
228 To successfully use the manpages feature requires the manpages to be
229 installed or on MANPATH, See man(1) for more details.
230
231 • -v, --version: Display version information for this tool, supported
232 tctis and exit.
233
234 • -V, --verbose: Increase the information that the tool prints to the
235 console during its execution. When using this option the file and
236 line number are printed.
237
238 • -Q, --quiet: Silence normal tool output to stdout.
239
240 • -Z, --enable-errata: Enable the application of errata fixups. Useful
241 if an errata fixup needs to be applied to commands sent to the TPM.
242 Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent. in‐
243 formation many users may expect.
244
246 The TCTI or “Transmission Interface” is the communication mechanism
247 with the TPM. TCTIs can be changed for communication with TPMs across
248 different mediums.
249
250 To control the TCTI, the tools respect:
251
252 1. The command line option -T or --tcti
253
254 2. The environment variable: TPM2TOOLS_TCTI.
255
256 Note: The command line option always overrides the environment vari‐
257 able.
258
259 The current known TCTIs are:
260
261 • tabrmd - The resource manager, called tabrmd
262 (https://github.com/tpm2-software/tpm2-abrmd). Note that tabrmd and
263 abrmd as a tcti name are synonymous.
264
265 • mssim - Typically used for communicating to the TPM software simula‐
266 tor.
267
268 • device - Used when talking directly to a TPM device file.
269
270 • none - Do not initalize a connection with the TPM. Some tools allow
271 for off-tpm options and thus support not using a TCTI. Tools that do
272 not support it will error when attempted to be used without a TCTI
273 connection. Does not support ANY options and MUST BE presented as
274 the exact text of “none”.
275
276 The arguments to either the command line option or the environment
277 variable are in the form:
278
279 <tcti-name>:<tcti-option-config>
280
281 Specifying an empty string for either the <tcti-name> or <tcti-op‐
282 tion-config> results in the default being used for that portion respec‐
283 tively.
284
285 TCTI Defaults
286 When a TCTI is not specified, the default TCTI is searched for using
287 dlopen(3) semantics. The tools will search for tabrmd, device and
288 mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND. You can query
289 what TCTI will be chosen as the default by using the -v option to print
290 the version information. The “default-tcti” key-value pair will indi‐
291 cate which of the aforementioned TCTIs is the default.
292
293 Custom TCTIs
294 Any TCTI that implements the dynamic TCTI interface can be loaded. The
295 tools internally use dlopen(3), and the raw tcti-name value is used for
296 the lookup. Thus, this could be a path to the shared library, or a li‐
297 brary name as understood by dlopen(3) semantics.
298
300 This collection of options are used to configure the various known TCTI
301 modules available:
302
303 • device: For the device TCTI, the TPM character device file for use by
304 the device TCTI can be specified. The default is /dev/tpm0.
305
306 Example: -T device:/dev/tpm0 or export TPM2TOOLS_TCTI=“de‐
307 vice:/dev/tpm0”
308
309 • mssim: For the mssim TCTI, the domain name or IP address and port
310 number used by the simulator can be specified. The default are
311 127.0.0.1 and 2321.
312
313 Example: -T mssim:host=localhost,port=2321 or export TPM2TOOLS_TC‐
314 TI=“mssim:host=localhost,port=2321”
315
316 • abrmd: For the abrmd TCTI, the configuration string format is a se‐
317 ries of simple key value pairs separated by a `,' character. Each
318 key and value string are separated by a `=' character.
319
320 • TCTI abrmd supports two keys:
321
322 1. `bus_name' : The name of the tabrmd service on the bus (a
323 string).
324
325 2. `bus_type' : The type of the dbus instance (a string) limited to
326 `session' and `system'.
327
328 Specify the tabrmd tcti name and a config string of bus_name=com.ex‐
329 ample.FooBar:
330
331 \--tcti=tabrmd:bus_name=com.example.FooBar
332
333 Specify the default (abrmd) tcti and a config string of bus_type=ses‐
334 sion:
335
336 \--tcti:bus_type=session
337
338 NOTE: abrmd and tabrmd are synonymous. the various known TCTI mod‐
339 ules.
340
342 tpm2_createprimary -C o -c prim.ctx -Q
343
344 tpm2_create -C prim.ctx -c key.ctx -u key.pub -r key.priv -G ecc256:ecdh -Q
345
346 tpm2_ecephemeral -u ecc.q -t ecc.ctr ecc256
347
348 tpm2_ecdhkeygen -u ecdh.pub -o ecdh.priv -c key.ctx
349
350 tpm2_zgen2phase -c key.ctx --static-public ecdh.pub --ephemeral-public ecc.q \
351 -t 0 --output-Z1 z1.bin --output-Z2 z2.bin
352
354 Tools can return any of the following codes:
355
356 • 0 - Success.
357
358 • 1 - General non-specific error.
359
360 • 2 - Options handling error.
361
362 • 3 - Authentication error.
363
364 • 4 - TCTI related error.
365
366 • 5 - Non supported scheme. Applicable to tpm2_testparams.
367
369 Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
370
372 See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)
373
374
375
376tpm2-tools tpm2_zgen2phase(1)