1tpm2_ecdhzgen(1)            General Commands Manual           tpm2_ecdhzgen(1)
2
3
4

NAME

6       tpm2_ecdhzgen(1)  -  Recovers the shared secret value (Z) from a public
7       point and a specified private key.
8

SYNOPSIS

10       tpm2_ecdhzgen [OPTIONS]
11

DESCRIPTION

13       tpm2_ecdhzgen(1) - Recovers the shared secret value (Z) from  a  public
14       point  and a specified private key.  It will perform the multiplication
15       of the provided inPoint (QB) with the private key (ds) and  return  the
16       coordinates of the resultant point (Z = (xZ , yZ) ≔ [hds]QB; where h is
17       the cofactor of the curve).
18

OPTIONS

20-c, --key-context=FILE:
21
22         Context object pointing to ECC key.  Either a file or a  handle  num‐
23         ber.  See section "Context Object Format".
24
25-p, --key-auth=AUTH:
26
27         The authorization value for the ECC key object.
28
29-u, --public=FILE:
30
31         Output ECC point Q.
32
33-o, --output=FILE
34
35         Specify file path to save the calculated ecdh secret or Z point.
36
37   References

Algorithm Specifiers

39       Options that take algorithms support "nice-names".
40
41       There  are two major algorithm specification string classes, simple and
42       complex.  Only certain algorithms will be accepted by the TPM, based on
43       usage and conditions.
44
45   Simple specifiers
46       These are strings with no additional specification data.  When creating
47       objects, non-specified portions of an object are assumed  to  defaults.
48       You can find the list of known "Simple Specifiers Below".
49
50   Asymmetric
51       • rsa
52
53       • ecc
54
55   Symmetric
56       • aes
57
58       • camellia
59
60   Hashing Algorithms
61       • sha1
62
63       • sha256
64
65       • sha384
66
67       • sha512
68
69       • sm3_256
70
71       • sha3_256
72
73       • sha3_384
74
75       • sha3_512
76
77   Keyed Hash
78       • hmac
79
80       • xor
81
82   Signing Schemes
83       • rsassa
84
85       • rsapss
86
87       • ecdsa
88
89       • ecdaa
90
91       • ecschnorr
92
93   Asymmetric Encryption Schemes
94       • oaep
95
96       • rsaes
97
98       • ecdh
99
100   Modes
101       • ctr
102
103       • ofb
104
105       • cbc
106
107       • cfb
108
109       • ecb
110
111   Misc
112       • null
113
114   Complex Specifiers
115       Objects,  when  specified  for creation by the TPM, have numerous algo‐
116       rithms to populate in the public data.  Things like  type,  scheme  and
117       asymmetric  details,  key  size,  etc.  Below is the general format for
118       specifying this data: <type>:<scheme>:<symmetric-details>
119
120   Type Specifiers
121       This portion of the complex algorithm specifier is required.   The  re‐
122       maining  scheme  and  symmetric  details will default based on the type
123       specified and the type of the object being created.
124
125       • aes - Default AES: aes128
126
127       • aes128<mode> - 128 bit AES with optional mode  (ctr|ofb|cbc|cfb|ecb).
128         If mode is not specified, defaults to null.
129
130       • aes192<mode> - Same as aes128<mode>, except for a 192 bit key size.
131
132       • aes256<mode> - Same as aes128<mode>, except for a 256 bit key size.
133
134       • ecc - Elliptical Curve, defaults to ecc256.
135
136       • ecc192 - 192 bit ECC
137
138       • ecc224 - 224 bit ECC
139
140       • ecc256 - 256 bit ECC
141
142       • ecc384 - 384 bit ECC
143
144       • ecc521 - 521 bit ECC
145
146       • rsa - Default RSA: rsa2048
147
148       • rsa1024 - RSA with 1024 bit keysize.
149
150       • rsa2048 - RSA with 2048 bit keysize.
151
152       • rsa4096 - RSA with 4096 bit keysize.
153
154   Scheme Specifiers
155       Next, is an optional field, it can be skipped.
156
157       Schemes  are  usually Signing Schemes or Asymmetric Encryption Schemes.
158       Most signing schemes take a hash algorithm directly following the sign‐
159       ing  scheme.   If the hash algorithm is missing, it defaults to sha256.
160       Some take no arguments, and some take multiple arguments.
161
162   Hash Optional Scheme Specifiers
163       These scheme specifiers are followed by a dash and a valid  hash  algo‐
164       rithm, For example: oaep-sha256.
165
166       • oaep
167
168       • ecdh
169
170       • rsassa
171
172       • rsapss
173
174       • ecdsa
175
176       • ecschnorr
177
178   Multiple Option Scheme Specifiers
179       This  scheme  specifier  is  followed by a count (max size UINT16) then
180       followed by a dash(-) and a valid hash algorithm.  * ecdaa For example,
181       ecdaa4-sha256.  If no count is specified, it defaults to 4.
182
183   No Option Scheme Specifiers
184       This scheme specifier takes NO arguments.  * rsaes
185
186   Symmetric Details Specifiers
187       This  field is optional, and defaults based on the type of object being
188       created and it's attributes.  Generally, any valid Symmetric  specifier
189       from  the Type Specifiers list should work.  If not specified, an asym‐
190       metric objects symmetric details defaults to aes128cfb.
191
192   Examples
193   Create an rsa2048 key with an rsaes asymmetric encryption scheme
194       tpm2_create -C parent.ctx -G rsa2048:rsaes -u key.pub -r key.priv
195
196   Create an ecc256 key with an ecdaa signing scheme with a count of 4
197       and sha384 hash
198
199       /tpm2_create -C parent.ctx -G ecc256:ec‐
200       daa4-sha384 -u key.pub -r key.priv cryptographic algorithms ALGORITHM.
201

COMMON OPTIONS

203       This  collection of options are common to many programs and provide in‐
204       formation that many users may expect.
205
206-h, --help=[man|no-man]: Display the tools manpage.  By  default,  it
207         attempts  to  invoke  the  manpager for the tool, however, on failure
208         will output a short tool summary.  This is the same behavior  if  the
209         "man"  option argument is specified, however if explicit "man" is re‐
210         quested, the tool will provide errors from man  on  stderr.   If  the
211         "no-man"  option  if  specified, or the manpager fails, the short op‐
212         tions will be output to stdout.
213
214         To successfully use the manpages feature requires the manpages to  be
215         installed or on MANPATH, See man(1) for more details.
216
217-v,  --version:  Display version information for this tool, supported
218         tctis and exit.
219
220-V, --verbose: Increase the information that the tool prints  to  the
221         console  during  its  execution.  When using this option the file and
222         line number are printed.
223
224-Q, --quiet: Silence normal tool output to stdout.
225
226-Z, --enable-errata: Enable the application of errata fixups.  Useful
227         if  an  errata fixup needs to be applied to commands sent to the TPM.
228         Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.   in‐
229         formation many users may expect.
230

TCTI Configuration

232       The  TCTI  or  "Transmission  Interface" is the communication mechanism
233       with the TPM.  TCTIs can be changed for communication with TPMs  across
234       different mediums.
235
236       To control the TCTI, the tools respect:
237
238       1. The command line option -T or --tcti
239
240       2. The environment variable: TPM2TOOLS_TCTI.
241
242       Note:  The  command  line option always overrides the environment vari‐
243       able.
244
245       The current known TCTIs are:
246
247       • tabrmd     -     The     resource     manager,     called      tabrmd
248         (https://github.com/tpm2-software/tpm2-abrmd).   Note that tabrmd and
249         abrmd as a tcti name are synonymous.
250
251       • mssim - Typically used for communicating to the TPM software  simula‐
252         tor.
253
254       • device - Used when talking directly to a TPM device file.
255
256       • none  - Do not initalize a connection with the TPM.  Some tools allow
257         for off-tpm options and thus support not using a TCTI.  Tools that do
258         not  support  it  will error when attempted to be used without a TCTI
259         connection.  Does not support ANY options and MUST  BE  presented  as
260         the exact text of "none".
261
262       The  arguments  to  either  the  command line option or the environment
263       variable are in the form:
264
265       <tcti-name>:<tcti-option-config>
266
267       Specifying an empty string for  either  the  <tcti-name>  or  <tcti-op‐
268       tion-config> results in the default being used for that portion respec‐
269       tively.
270
271   TCTI Defaults
272       When a TCTI is not specified, the default TCTI is  searched  for  using
273       dlopen(3)  semantics.   The  tools  will  search for tabrmd, device and
274       mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND.  You  can  query
275       what TCTI will be chosen as the default by using the -v option to print
276       the version information.  The "default-tcti" key-value pair will  indi‐
277       cate which of the aforementioned TCTIs is the default.
278
279   Custom TCTIs
280       Any TCTI that implements the dynamic TCTI interface can be loaded.  The
281       tools internally use dlopen(3), and the raw tcti-name value is used for
282       the lookup.  Thus, this could be a path to the shared library, or a li‐
283       brary name as understood by dlopen(3) semantics.
284

TCTI OPTIONS

286       This collection of options are used to configure the various known TCTI
287       modules available:
288
289device: For the device TCTI, the TPM character device file for use by
290         the device TCTI can be specified.  The default is /dev/tpm0.
291
292         Example:   -T   device:/dev/tpm0   or   export    TPM2TOOLS_TCTI="de‐
293         vice:/dev/tpm0"
294
295        mssim:  For  the  mssim  TCTI, the domain name or IP address and port
296         number used by the simulator  can  be  specified.   The  default  are
297         127.0.0.1 and 2321.
298
299         Example:  -T  mssim:host=localhost,port=2321  or export TPM2TOOLS_TC‐
300         TI="mssim:host=localhost,port=2321"
301
302        abrmd: For the abrmd TCTI, the configuration string format is  a  se‐
303         ries  of  simple  key value pairs separated by a ',' character.  Each
304         key and value string are separated by a '=' character.
305
306         • TCTI abrmd supports two keys:
307
308           1. 'bus_name' : The name of  the  tabrmd  service  on  the  bus  (a
309              string).
310
311           2. 'bus_type' : The type of the dbus instance (a string) limited to
312              'session' and 'system'.
313
314         Specify the tabrmd tcti name and a config string of  bus_name=com.ex‐
315         ample.FooBar:
316
317         \--tcti=tabrmd:bus_name=com.example.FooBar
318
319         Specify the default (abrmd) tcti and a config string of bus_type=ses‐
320         sion:
321
322         \--tcti:bus_type=session
323
324         NOTE: abrmd and tabrmd are synonymous.  the various known  TCTI  mod‐
325         ules.
326

EXAMPLES

328              tpm2_createprimary -C o -c prim.ctx -Q
329
330              tpm2_create -C prim.ctx -c key.ctx -u key.pub -r key.priv -G ecc256:ecdh
331
332              tpm2_ecdhkeygen -u ecdh.pub -o ecdh.priv -c key.ctx
333
334              tpm2_ecdhzgen -u ecdh.pub -o ecdh.dat -c key.ctx
335

Returns

337       Tools can return any of the following codes:
338
339       • 0 - Success.
340
341       • 1 - General non-specific error.
342
343       • 2 - Options handling error.
344
345       • 3 - Authentication error.
346
347       • 4 - TCTI related error.
348
349       • 5 - Non supported scheme.  Applicable to tpm2_testparams.
350

BUGS

352       Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
353

HELP

355       See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)
356
357
358
359tpm2-tools                                                    tpm2_ecdhzgen(1)
Impressum