tpm2_geteccparameters(1)

๐Ÿ’… tpm2_geteccparameters(1) โ€” like, the General Commands Manual, bestie ๐ŸŽ€

okay so real talk: this is a page from tpm2-tools, and it's literally the manual for tpm2_geteccparameters(1). Buckle up, she's a long one but we're gonna get through it together ๐Ÿซถ

โœจ NAME โœจ

tpm2_geteccparameters(1) โ€” grabs the parameters of an ECC curve, and the curve is identified by its TCG-assigned curveID. that's it, that's the whole vibe ๐Ÿ’ซ

โœจ SYNOPSIS โœจ

tpm2_geteccparameters [OPTIONS]

โœจ DESCRIPTION โœจ

tpm2_geteccparameters(1) โ€” Retrieves the parameters of an ECC curve identified by its TCG-assigned curveID. yes she's repeating herself, but honestly? iconic. no cap, that's the entire job ๐Ÿ“‹

โœจ OPTIONS โœจ

  • ARGUMENT=ALGORITHM โ€” specify which ECC curve you want, bestie. example: ecc521 ๐ŸŒธ
  • -o, --output=FILE โ€” tell her where to save the ECC parameters (the file path, specifically) ๐Ÿ’พ
  • --cphash=FILE โ€” file path where the hash of the command parameters gets recorded. people usually call this the cpHash. โš ๏ธ big important NOTE: when you pick this option, the tool will not actually execute the command โ€” it just hands you a cpHash and that's it. so don't come crying that nothing happened ๐Ÿ˜ญ

๐Ÿ“š References

๐Ÿ”ฎ Algorithm Specifiers

options that take algorithms support โ€œnice-namesโ€. cute, right?

there are two major algorithm specification string classes: simple and complex. and heads up โ€” only certain algorithms will be accepted by the TPM, based on usage and conditions. the TPM is picky like that ๐Ÿ™ˆ

๐ŸŒผ Simple specifiers

these are strings with no additional specification data. when you're creating objects, any non-specified portions of an object are assumed to be defaults. the list of known โ€œSimple Specifiersโ€ is right below ๐Ÿ‘‡

๐Ÿฆ‹ Asymmetric

  • rsa
  • ecc

๐Ÿ“ Symmetric

  • aes
  • camellia
  • sm4

๐Ÿ’œ Hashing Algorithms

  • sha1
  • sha256
  • sha384
  • sha512
  • sm3_256
  • sha3_256
  • sha3_384
  • sha3_512

๐ŸŽ€ Keyed Hash

  • hmac
  • xor

โœจ Signing Schemes

  • rsassa
  • rsapss
  • ecdsa
  • ecdaa
  • ecschnorr
  • sm2

๐ŸŒˆ Asymmetric Encryption Schemes

  • oaep
  • rsaes
  • ecdh

๐Ÿงš Modes

  • ctr
  • ofb
  • cbc
  • cfb
  • ecb

โญ Misc

  • null

๐ŸŒธ Complex Specifiers

when objects get specified for creation by the TPM, they've got numerous algorithms to populate in the public data. stuff like type, scheme and asymmetric details, key size, etc. the general format for specifying this data is:

<type>:<scheme>:<symmetric-details>

๐Ÿ‘‘ Type Specifiers

this portion of the complex algorithm specifier is required. the remaining scheme and symmetric details will default based on the type specified and the type of the object being created. no skipping this one, bestie ๐Ÿšจ

  • aes โ€” Default AES: aes128
  • aes128<mode> โ€” 128 bit AES with optional mode (ctr|ofb|cbc|cfb|ecb). if mode is not specified, it defaults to null.
  • aes192<mode> โ€” same as aes128<mode>, except for a 192 bit key size.
  • aes256<mode> โ€” same as aes128<mode>, except for a 256 bit key size.
  • sm4 โ€” Default SM4: sm4128
  • sm4128 or sm4_128 <mode> โ€” 128 bit SM4 with optional mode (ctr|ofb|cbc|cfb|ecb). if mode is not specified, it defaults to null.
  • ecc โ€” Elliptical Curve, defaults to ecc256.
  • ecc192 or ecc_nist_p192 โ€” 192 bit ECC NIST curve
  • ecc224 or ecc_nist_p224 โ€” 224 bit ECC NIST curve
  • ecc256 or ecc_nist_p256 โ€” 256 bit ECC NIST curve
  • ecc384 or ecc_nist_p384 โ€” 384 bit ECC NIST curve
  • ecc521 or ecc_nist_p521 โ€” 521 bit ECC NIST curve
  • ecc_sm2 or ecc_sm2_p256 โ€” 256 bit SM2 curve
  • rsa โ€” Default RSA: rsa2048
  • rsa1024 โ€” RSA with 1024 bit keysize.
  • rsa2048 โ€” RSA with 2048 bit keysize.
  • rsa3072 โ€” RSA with 3072 bit keysize.
  • rsa4096 โ€” RSA with 4096 bit keysize.

๐Ÿ’ซ Scheme Specifiers

next up is an optional field โ€” you can literally just skip it, no pressure ๐Ÿซถ

schemes are usually Signing Schemes or Asymmetric Encryption Schemes. most signing schemes take a hash algorithm directly following the signing scheme. if the hash algorithm is missing, it defaults to sha256. some take no arguments, and some take multiple arguments. chaotic, i know.

๐Ÿง Hash Optional Scheme Specifiers

these scheme specifiers are followed by a dash and a valid hash algorithm. for example: oaep-sha256.

  • oaep
  • ecdh
  • rsassa
  • rsapss
  • ecdsa
  • ecschnorr
  • sm2

๐Ÿฐ Multiple Option Scheme Specifiers

this scheme specifier is followed by a count (max size UINT16) then followed by a dash (-) and a valid hash algorithm. * ecdaa for example, ecdaa4-sha256. if no count is specified, it defaults to 4.

๐ŸŽฏ No Option Scheme Specifiers

this scheme specifier takes NO arguments. * rsaes

๐Ÿฆข Symmetric Details Specifiers

this field is optional, and defaults based on the type of object being created and it's attributes. generally, any valid Symmetric specifier from the Type Specifiers list should work. if not specified, an asymmetric object's symmetric details defaults to aes128cfb. slay ๐Ÿ’…

๐ŸŒŸ Examples

create an rsa2048 key with an rsaes asymmetric encryption scheme

tpm2_create -C parent.ctx -G rsa2048:rsaes -u key.pub -r key.priv

create an ecc256 key with an ecdaa signing scheme with a count of 4 and sha384 hash

/tpm2_create -C parent.ctx -G ecc256:ecdaa4-sha384 -u key.pub -r key.priv cryptographic algorithms ALGORITHM.

๐Ÿ’– COMMON OPTIONS ๐Ÿ’–

this collection of options are common to many programs and provide information that many users may expect. the friend group of options, if you will ๐Ÿ‘ฏโ€โ™€๏ธ

  • -h, --help=[man|no-man] โ€” Display the tool's manpage. by default, it attempts to invoke the manpager for the tool, however, on failure it will output a short tool summary. this is the same behavior if the โ€œmanโ€ option argument is specified, however if explicit โ€œmanโ€ is requested, the tool will provide errors from man on stderr. if the โ€œno-manโ€ option is specified, or the manpager fails, the short options will be output to stdout.
to successfully use the manpages feature you need the manpages installed or on MANPATH. see man(1) for more details. iykyk ๐Ÿ“–
  • -v, --version โ€” Display version information for this tool, supported tctis and exit. ๐Ÿ‘‹
  • -V, --verbose โ€” Increase the information that the tool prints to the console during its execution. when using this option the file and line number are printed. she's chatty and we love her ๐Ÿ—ฃ๏ธ
  • -Q, --quiet โ€” Silence normal tool output to stdout. ๐Ÿคซ
  • -Z, --enable-errata โ€” Enable the application of errata fixups. useful if an errata fixup needs to be applied to commands sent to the TPM. defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent. ๐Ÿ”ง
  • -z, --pwd-session โ€” Use password session instead of a HMAC session for authentication. a clear text password is passed to the TPM to authorize the action. this option can be used to avoid problems when unsalted sessions are used in OpenSSL FIPS mode. if auth values are used a salted session should be used for authentication. ๐Ÿ”
  • -R, --autoflush โ€” Enable autoflush for transient objects created by the command. if a parent object is loaded from a context file also the transient parent object will be flushed. autoflush can also be activated if the environment variable TPM2TOOLS_AUTOFLUSH is is set to yes or true. ๐Ÿšฝโœจ

information many users may expect.


๐Ÿ“ก TCTI Configuration

the TCTI or โ€œTransmission Interfaceโ€ is the communication mechanism with the TPM. TCTIs can be changed for communication with TPMs across different mediums. she's the group chat bridge between you and the TPM ๐Ÿ’ฌ

to control the TCTI, the tools respect:

  1. the command line option -T or --tcti
  2. the environment variable: TPM2TOOLS_TCTI.
Note: the command line option always overrides the environment variable. no arguing ๐Ÿซต

the current known TCTIs are:

  • tabrmd โ€” the resource manager, called tabrmd. note that tabrmd and abrmd as a tcti name are synonymous. two names, one queen ๐Ÿ‘‘
  • mssim โ€” typically used for communicating to the TPM software simulator.
  • device โ€” used when talking directly to a TPM device file.
  • none โ€” do not initalize a connection with the TPM. some tools allow for off-tpm options and thus support not using a TCTI. tools that do not support it will error when attempted to be used without a TCTI connection. does not support ANY options and MUST BE presented as the exact text of โ€œnoneโ€. she's strict like that ๐Ÿšซ

the arguments to either the command line option or the environment variable are in the form:

<tcti-name>:<tcti-option-config>

specifying an empty string for either the <tcti-name> or <tcti-option-config> results in the default being used for that portion respectively. ๐Ÿซง

๐ŸŒ™ TCTI Defaults

when a TCTI is not specified, the default TCTI is searched for using dlopen(3) semantics. the tools will search for tabrmd, device and mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND. you can query what TCTI will be chosen as the default by using the -v option to print the version information. the โ€œdefault-tctiโ€ key-value pair will indicate which of the aforementioned TCTIs is the default. first come, first served fr fr ๐Ÿ

๐Ÿงš Custom TCTIs

any TCTI that implements the dynamic TCTI interface can be loaded. the tools internally use dlopen(3), and the raw tcti-name value is used for the lookup. thus, this could be a path to the shared library, or a library name as understood by dlopen(3) semantics. bring your own, bestie ๐ŸŽ


๐Ÿ”Œ TCTI OPTIONS

this collection of options are used to configure the various known TCTI modules available:

  • device โ€” for the device TCTI, the TPM character device file for use by the device TCTI can be specified. the default is /dev/tpm0.

example: -T device:/dev/tpm0 or export TPM2TOOLS_TCTI=โ€œdevice:/dev/tpm0โ€

  • mssim โ€” for the mssim TCTI, the domain name or IP address and port number used by the simulator can be specified. the defaults are 127.0.0.1 and 2321.

example: -T mssim:host=localhost,port=2321 or export TPM2TOOLS_TCTI=โ€œmssim:host=localhost,port=2321โ€

  • abrmd โ€” for the abrmd TCTI, the configuration string format is a series of simple key value pairs separated by a , character. each key and value string are separated by a = character.

TCTI abrmd supports two keys:

  1. bus_name : the name of the tabrmd service on the bus (a string).
  2. bus_type : the type of the dbus instance (a string) limited to session and system.

specify the tabrmd tcti name and a config string of bus_name=com.example.FooBar:

\--tcti=tabrmd:bus_name=com.example.FooBar

specify the default (abrmd) tcti and a config string of bus_type=session:

\--tcti:bus_type=session
NOTE: abrmd and tabrmd are synonymous. the various known TCTI modules. ๐Ÿซถ

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

tpm2_geteccparameters ecc256 -o ecc.params

look at her go ๐Ÿ˜ญ๐Ÿ’–


๐ŸŽ€ Returns

tools can return any of the following codes:

  • 0 โ€” Success. ๐ŸŽ‰
  • 1 โ€” General non-specific error. ๐Ÿ’€
  • 2 โ€” Options handling error. ๐Ÿ™ƒ
  • 3 โ€” Authentication error. ๐Ÿ”’
  • 4 โ€” TCTI related error. ๐Ÿ“ก
  • 5 โ€” Non supported scheme. applicable to tpm2_testparams.

๐Ÿ› BUGS

Github Issues โ€” yes, that's where you go. go tell 'em ๐Ÿซก


๐Ÿ†˜ HELP

See the Mailing List ๐Ÿ“ฌ


โš–๏ธ License

this work is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). ๐Ÿ“œ


and that's the whole page, bestie ๐ŸŽ€โœจ this has been tpm2_geteccparameters(1) from the tpm2-tools package โ€” mwah, go touch some ECC curves ๐Ÿ’…๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from