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  and
197       sha384 hash
198       /tpm2_create  -C  parent.ctx  -G  ecc256:ecdaa4-sha384  -u  key.pub  -r
199       key.priv cryptographic algorithms ALGORITHM.
200

COMMON OPTIONS

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

TCTI Configuration

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

TCTI OPTIONS

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

EXAMPLES

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

Returns

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

BUGS

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

HELP

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