/**
  * Check the HMAC of an ingoing Threema request. Always do this before de-
  * crypting the message.
  *
  * @param string $threemaId
  * @param string $gatewayId
  * @param string $messageId
  * @param string $date
  * @param string $nonce nonce as hex encoded string
  * @param string $box box as hex encoded string
  * @param string $mac the original one send by the server
  *
  * @return bool true if check was successfull, false if not
  */
 public final function checkMac($threemaId, $gatewayId, $messageId, $date, $nonce, $box, $mac, $secret)
 {
     $calculatedMac = hash_hmac('sha256', $threemaId . $gatewayId . $messageId . $date . $nonce . $box, $secret);
     return $this->cryptTool->stringCompare($calculatedMac, $mac) === true;
 }