ParagonIE\Halite\Symmetric\Crypto::calculateMAC PHP Method

calculateMAC() protected static method

Calculate a MAC. This is used internally.
protected static calculateMAC ( string $message, string $authKey, SymmetricConfig $config ) : string
$message string
$authKey string
$config SymmetricConfig
return string
    protected static function calculateMAC(string $message, string $authKey, SymmetricConfig $config) : string
    {
        if ($config->MAC_ALGO === 'BLAKE2b') {
            return \Sodium\crypto_generichash($message, $authKey, $config->MAC_SIZE);
        }
        throw new InvalidMessage('Invalid Halite version');
    }