def _getMAC(self, mac, key):
        mod = self.macMap[mac]
        if not mod:
            return (None, b'', b'', 0)

        # With stdlib we can only get attributes fron an instantiated object.
        hashObject = mod()
        digestSize = hashObject.digest_size
        blockSize = hashObject.block_size

        # Truncation here appears to contravene RFC 2104, section 2.  However,
        # implementing the hashing behavior prescribed by the RFC breaks
        # interoperability with OpenSSH (at least version 5.5p1).
        key = key[:digestSize] + (b'\x00' * (blockSize - digestSize))
        i = key.translate(hmac.trans_36)
        o = key.translate(hmac.trans_5C)
        result = _MACParams((mod, i, o, digestSize))
        result.key = key
        return result
Test that flows refuse to processes unauthenticated messages.
dataset/ETHPy150Open twisted/twisted/twisted/conch/ssh/transport.py/SSHCiphers._getMAC--crossover with--dataset/ETHPy150Open google/grr/grr/lib/flow_test.py/FlowTest.testAuthentication2