Microsoft publishes TPM 2.0 reference code

If you are familiar with the Trusted Computing Group (TCG) and it’s  TPM 2.0 Library Specification, you probably heard that it was explicitly written in a way that allows it to be translated by a parser into (semi-) executable code. At least the code to marshal command and responses and perform validation checks is generated. The specification also comes with most of the logic inside the different TPM commands. To make a usable TPM implementation out of that specification one has to add a wrapper that funnels the commands into that generated code and the preferred crypto library to perform the math required by the TPM code.

Microsoft, as primary editor, has provided the parser for the specification and kept the reference implementation and the specification in sync. This reference implementation has always been available to members of the TCG. Especially TPM vendors used this reference code as blueprint to innovate on and add their improved cryptographic logic to it.

However, the only means for the general public to get access to the TPM 2.0 reference code was to parse the TPM 2.0 library specification and generate the reference code themselves. With the availability of the TPM 2.0 reference code on GitHub this hurdle has now been removed. This also allows researchers who were less interested in generating the reference code but more in using it to have free access to it.