Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 784 Bytes

rng.md

File metadata and controls

26 lines (21 loc) · 784 Bytes

Random Number Generation

The tpm2 provider implements a OSSL_OP_RAND operation, which retrieves random bytes from the TPM. It is made available to applications via the EVP_RAND API function and the openssl rand command.

For example, to generate 10 bytes:

openssl rand -provider tpm2 -hex 10

This is similar to:

tpm2_getrandom --hex 10

Note: For compatibility reasons is the number generator named CTR-DRBG, although the TPM uses a completely different mechanism.

Gettable parameters (API only):

  • max_request (size_t) defines maximal size of a single request.