tpm2_ecdhzgen.1 11 KB

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