# Parameters

In Tink, the **parameters** of a key consist of the information which was used to create the key. This does not include the *key material randomness* and the *key ID*.

Tink [keys](https://developers.google.com/tink/design/keys) consist of both key material and metadata. The
section on tagging ciphertexts
[explains](https://developers.google.com/tink/design/keysets#key_identifiers_in_ciphertexts) how Tink also
allows to prefix ciphertexts with a 5-byte string derived from the ID, which
means that the key also depends on the ID it has in the keyset.

Therefore, to create a new key, Tink uses in general the following ingredients:

- An object describing all **parameters**
- The ID of the new key
- Uniform, cryptographically secure randomness

## Example

Consider for example HMAC ([RFC 2014](https://www.rfc-editor.org/rfc/rfc2104)).
To specify an HMAC computation in Tink, one needs to provide the following
information, which form the key:

- The key material of HMAC.
- The hash function to be used.
- The output length of the HMAC (see ([RFC 2014, Section
  5](https://www.rfc-editor.org/rfc/rfc2104#section-5))) - if truncated.
- The Tink specific [prefix with which every tag
  starts](https://developers.google.com/tink/design/keysets#tagging_ciphertexts) (if any).

The corresponding parameters consist of all this information, except the actual
key material. More specifically:

- The length of the key material.
- The hash function used.
- The output length of the HMAC - if truncated.
- A specification of how to find the prefix from the ID.

Together with the key material and the ID, this forms the full key. See also
more details on how these objects are [implemented](https://developers.google.com/tink/design/key_objects).