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

@param string $message
@param string $authKey
@param SymmetricConfig $config
@return string
@throws InvalidMessage
Calculate a MAC . This is used internally .