Hash() 개인적인 메소드

private Hash ( byte data, TpmAlgId hashAlg, TpmHandle hierarchy, [ validation ) : byte[]
data byte
hashAlg TpmAlgId
hierarchy TpmHandle
validation [
리턴 byte[]
예제 #1
0
        int IEqualityComparer <byte[]> .GetHashCode(byte[] obj)
        {
            TkHashcheck validation;

            return(BitConverter.ToInt32(my_tpm.Hash(obj as byte[], TpmAlgId.Sha1, TpmRh.Owner, out validation), 0));
        }
예제 #2
0
 /// <summary>
 /// Very simple hash calculation. 
 /// We ask the TPM to calculate the hash of a 3-byte array.
 /// </summary>
 /// <param name="tpm">Reference to the TPM object.</param>
 static void SimpleHash(Tpm2 tpm)
 {
     TkHashcheck validation;
     byte[] hashData = tpm.Hash(new byte[] { 1, 2, 3 },   // Data to hash
                                TpmAlgId.Sha256,          // Hash algorithm
                                TpmHandle.RhOwner,        // Hierarchy for ticket (not used here)
                                out validation);          // Ticket (not used in this example)
     Console.WriteLine("Hashed data (Hash): " + BitConverter.ToString(hashData));
 }