public TpmHash GetSelectionHash(TpmAlgId hashAlg)
{
var m = new Marshaller();
PcrSelection[] selections = GetPcrSelectionArray();
foreach (PcrSelection sel in selections)
{
uint[] pcrIndices = sel.GetSelectedPcrs();
foreach (uint index in pcrIndices)
{
PcrValue v = GetSpecificValue(sel.hash, index);
m.Put(v.value.HashData, "hash");
}
}
var valueHash = new TpmHash(hashAlg, CryptoLib.HashData(hashAlg, m.GetBytes()));
return valueHash;
}