/* If HmacMdContext is NULL, then return FALSE. If HmacValue is NULL, then return FALSE. */
STATIC BOOLEAN HmacMdFinal(IN OUT VOID *HmacMdContext, OUT UINT8 *HmacValue)
/* If HmacMdContext is NULL, then return FALSE. If HmacValue is NULL, then return FALSE. */
STATIC BOOLEAN HmacMdFinal(IN OUT VOID *HmacMdContext, OUT UINT8 *HmacValue)
{
  UINT32  Length;
  if ((HmacMdContext == NULL) || (HmacValue == NULL)) {
    return FALSE;
  }
  if (HMAC_Final ((HMAC_CTX *)HmacMdContext, HmacValue, &Length) != 1) {
    return FALSE;
  }
  if (HMAC_CTX_reset ((HMAC_CTX *)HmacMdContext) != 1) {
    return FALSE;
  }
  return TRUE;
}