func (a Algorithm) UsesHash() bool {
	return a == AlgOAEP
}
UsesHash returns true if the algorithm requires the use of a hash.
package tpm2
import (
	"crypto"
	"crypto/elliptic"
	"fmt"
	"strings"
	_ "crypto/sha1"
	_ "crypto/sha256"
	_ "crypto/sha512"
	"github.com/google/go-tpm/tpmutil"
)
var hashInfo = []struct {
	alg  Algorithm
	hash crypto.Hash
}{
	{AlgSHA1, crypto.SHA1},
	{AlgSHA256, crypto.SHA256},
	{AlgSHA384, crypto.SHA384},
	{AlgSHA512, crypto.SHA512},
	{AlgSHA3_256, crypto.SHA3_256},
	{AlgSHA3_384, crypto.SHA3_384},
	{AlgSHA3_512, crypto.SHA3_512},
}
const maxDigestBuffer = 1024
type Algorithm uint16
func HashToAlgorithm(hash crypto.Hash) (Algorithm, error) {
	for _, info := range hashInfo {
		if info.hash == hash {
			return info.alg, nil
		}
	}
	return AlgUnknown, fmt.Errorf("go hash algorithm #%d has no TPM2 algorithm", hash)
}
func (a Algorithm) IsNull() bool {
	return a == AlgNull || a == AlgUnknown
}
func (a Algorithm) UsesCount() bool {
	return a == AlgECDAA
}