/* This function completes sha3 hash computation and retrieves the digest value into the specified memory. After this function has been called, the keccak context cannot be used again. */
UINT8 EFIAPI Sha3Final(IN OUT Keccak1600_Ctx *Context, OUT UINT8 *MessageDigest)
/* This function completes sha3 hash computation and retrieves the digest value into the specified memory. After this function has been called, the keccak context cannot be used again. */
UINT8 EFIAPI Sha3Final(IN OUT Keccak1600_Ctx *Context, OUT UINT8 *MessageDigest)
{
  UINTN  BlockSize;
  UINTN  Num;
  BlockSize = Context->block_size;
  Num       = Context->num;
  if (Context->md_size == 0) {
    return 1;
  }
  memset (Context->buf + Num, 0, BlockSize - Num);
  Context->buf[Num]            = Context->pad;
  Context->buf[BlockSize - 1] |= 0x80;
  (void)SHA3_absorb (Context->A, Context->buf, BlockSize, BlockSize);
  SHA3_squeeze (Context->A, MessageDigest, Context->md_size, BlockSize);
  return 1;
}