| // This file was extracted from the TCG Published |
| // Trusted Platform Module Library |
| // Level 00 Revision 01.16 |
| #include "InternalRoutines.h" |
| // This function is called to process a _TPM_Hash_Data() indication. |
| UINT32 dataSize, // IN: size of data to be extend |
| BYTE *data // IN: data buffer |
| TPMI_DH_PCR pcrHandle = TPMIsStarted() |
| ? PCR_FIRST + DRTM_PCR : PCR_FIRST + HCRTM_PCR; |
| // If there is no DRTM sequence object, then _TPM_Hash_Start |
| // was not called so this function returns without doing |
| if(g_DRTMHandle == TPM_RH_UNASSIGNED) |
| hashObject = (HASH_OBJECT *)ObjectGet(g_DRTMHandle); |
| pAssert(hashObject->attributes.eventSeq); |
| // For each of the implemented hash algorithms, update the digest with the |
| for(i = 0; i < HASH_COUNT; i++) |
| // make sure that the PCR is implemented for this algorithm |
| if(PcrIsAllocated(pcrHandle, |
| hashObject->state.hashState[i].state.hashAlg)) |
| // Update sequence object |
| CryptUpdateDigest(&hashObject->state.hashState[i], dataSize, data); |