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
212 and sha384 hash
213
214 /tpm2_create -C parent.ctx -G ecc256:ec‐
215 daa4-sha384 -u key.pub -r key.priv cryptographic algorithms ALGORITHM.
216
218 This collection of options are common to many programs and provide in‐
219 formation that many users may expect.
220
221 • -h, --help=[man|no-man]: Display the tools manpage. By default, it
222 attempts to invoke the manpager for the tool, however, on failure
223 will output a short tool summary. This is the same behavior if the
224 "man" option argument is specified, however if explicit "man" is re‐
225 quested, the tool will provide errors from man on stderr. If the
226 "no-man" option if specified, or the manpager fails, the short op‐
227 tions will be output to stdout.
228
229 To successfully use the manpages feature requires the manpages to be
230 installed or on MANPATH, See man(1) for more details.
231
232 • -v, --version: Display version information for this tool, supported
233 tctis and exit.
234
235 • -V, --verbose: Increase the information that the tool prints to the
236 console during its execution. When using this option the file and
237 line number are printed.
238
239 • -Q, --quiet: Silence normal tool output to stdout.
240
241 • -Z, --enable-errata: Enable the application of errata fixups. Useful
242 if an errata fixup needs to be applied to commands sent to the TPM.
243 Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent. in‐
244 formation many users may expect.
245
247 The TCTI or "Transmission Interface" is the communication mechanism
248 with the TPM. TCTIs can be changed for communication with TPMs across
249 different mediums.
250
251 To control the TCTI, the tools respect:
252
253 1. The command line option -T or --tcti
254
255 2. The environment variable: TPM2TOOLS_TCTI.
256
257 Note: The command line option always overrides the environment vari‐
258 able.
259
260 The current known TCTIs are:
261
262 • tabrmd - The resource manager, called tabrmd
263 (https://github.com/tpm2-software/tpm2-abrmd). Note that tabrmd and
264 abrmd as a tcti name are synonymous.
265
266 • mssim - Typically used for communicating to the TPM software simula‐
267 tor.
268
269 • device - Used when talking directly to a TPM device file.
270
271 • none - Do not initalize a connection with the TPM. Some tools allow
272 for off-tpm options and thus support not using a TCTI. Tools that do
273 not support it will error when attempted to be used without a TCTI
274 connection. Does not support ANY options and MUST BE presented as
275 the exact text of "none".
276
277 The arguments to either the command line option or the environment
278 variable are in the form:
279
280 <tcti-name>:<tcti-option-config>
281
282 Specifying an empty string for either the <tcti-name> or <tcti-op‐
283 tion-config> results in the default being used for that portion respec‐
284 tively.
285
286 TCTI Defaults
287 When a TCTI is not specified, the default TCTI is searched for using
288 dlopen(3) semantics. The tools will search for tabrmd, device and
289 mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND. You can query
290 what TCTI will be chosen as the default by using the -v option to print
291 the version information. The "default-tcti" key-value pair will indi‐
292 cate which of the aforementioned TCTIs is the default.
293
294 Custom TCTIs
295 Any TCTI that implements the dynamic TCTI interface can be loaded. The
296 tools internally use dlopen(3), and the raw tcti-name value is used for
297 the lookup. Thus, this could be a path to the shared library, or a li‐
298 brary name as understood by dlopen(3) semantics.
299
301 This collection of options are used to configure the various known TCTI
302 modules available:
303
304 • device: For the device TCTI, the TPM character device file for use by
305 the device TCTI can be specified. The default is /dev/tpm0.
306
307 Example: -T device:/dev/tpm0 or export TPM2TOOLS_TCTI="de‐
308 vice:/dev/tpm0"
309
310 • mssim: For the mssim TCTI, the domain name or IP address and port
311 number used by the simulator can be specified. The default are
312 127.0.0.1 and 2321.
313
314 Example: -T mssim:host=localhost,port=2321 or export TPM2TOOLS_TC‐
315 TI="mssim:host=localhost,port=2321"
316
317 • abrmd: For the abrmd TCTI, the configuration string format is a se‐
318 ries of simple key value pairs separated by a ',' character. Each
319 key and value string are separated by a '=' character.
320
321 • TCTI abrmd supports two keys:
322
323 1. 'bus_name' : The name of the tabrmd service on the bus (a
324 string).
325
326 2. 'bus_type' : The type of the dbus instance (a string) limited to
327 'session' and 'system'.
328
329 Specify the tabrmd tcti name and a config string of bus_name=com.ex‐
330 ample.FooBar:
331
332 \--tcti=tabrmd:bus_name=com.example.FooBar
333
334 Specify the default (abrmd) tcti and a config string of bus_type=ses‐
335 sion:
336
337 \--tcti:bus_type=session
338
339 NOTE: abrmd and tabrmd are synonymous. the various known TCTI mod‐
340 ules.
341
343 tpm2_createprimary -C o -c prim.ctx -Q
344
345 tpm2_create -C prim.ctx -c key.ctx -u key.pub -r key.priv -G ecc256:ecdh -Q
346
347 tpm2_ecephemeral -u ecc.q -t ecc.ctr ecc256
348
349 tpm2_ecdhkeygen -u ecdh.pub -o ecdh.priv -c key.ctx
350
351 tpm2_zgen2phase -c key.ctx --static-public ecdh.pub --ephemeral-public ecc.q \
352 -t 0 --output-Z1 z1.bin --output-Z2 z2.bin
353
355 Tools can return any of the following codes:
356
357 • 0 - Success.
358
359 • 1 - General non-specific error.
360
361 • 2 - Options handling error.
362
363 • 3 - Authentication error.
364
365 • 4 - TCTI related error.
366
367 • 5 - Non supported scheme. Applicable to tpm2_testparams.
368
370 Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
371
373 See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)
374
375
376
377tpm2-tools tpm2_zgen2phase(1)