TPMLIB\_GetVersion(3) TPMLIB\_GetVersion(3)

# [NAME](#NAME)

TPMLIB\_GetVersion - Get the version of the TPM library

# [LIBRARY](#LIBRARY)

TPM library (libtpms, -ltpms)

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;libtpms/tpm\_library.h**&gt;

**uint32\_t TPMLIB\_GetVersion(void);**

# [DESCRIPTION](#DESCRIPTION)

The **TPMLIB\_GetVersion()** function returns the libtpms library version. The TPM library version is formatted as follows:

```
        Bits 0 - 7  : revision of the library
        Bits 8 -15  : minor version number of the library
        Bits 16-23  : major version number of the library
```

V0.5.1 is therefore represented as 0x00000501.

# [SEE ALSO](#SEE_ALSO)

[**TPMLIB\_MainInit**(3)](/man/enterprise-packages/libtpms/TPMLIB_MainInit.3), [**TPMLIB\_Terminate**(3)](/man/enterprise-packages/libtpms/TPMLIB_Terminate.3)

2026-10-01 libtpms

---

Document: TPMLIB_GetVersion(3) from libtpms 0.10.2-r3 (Chainguard OS)
Source: https://github.com/stefanberger/libtpms
