/* Return if hash alg is supported in HashAlgorithmMask. */
BOOLEAN EFIAPI IsHashAlgSupportedInHashAlgorithmMask(IN TPMI_ALG_HASH HashAlg, IN UINT32 HashAlgorithmMask)
/* Return if hash alg is supported in HashAlgorithmMask. */
BOOLEAN EFIAPI IsHashAlgSupportedInHashAlgorithmMask(IN TPMI_ALG_HASH HashAlg, IN UINT32 HashAlgorithmMask)
{
  switch (HashAlg) {
    case TPM_ALG_SHA1:
      if ((HashAlgorithmMask & HASH_ALG_SHA1) != 0) {
        return TRUE;
      }
      break;
    case TPM_ALG_SHA256:
      if ((HashAlgorithmMask & HASH_ALG_SHA256) != 0) {
        return TRUE;
      }
      break;
    case TPM_ALG_SHA384:
      if ((HashAlgorithmMask & HASH_ALG_SHA384) != 0) {
        return TRUE;
      }
      break;
    case TPM_ALG_SHA512:
      if ((HashAlgorithmMask & HASH_ALG_SHA512) != 0) {
        return TRUE;
      }
      break;
    case TPM_ALG_SM3_256:
      if ((HashAlgorithmMask & HASH_ALG_SM3_256) != 0) {
        return TRUE;
      }
      break;
  }
  return FALSE;
}