'Test that setKeys sets up the MACs.'

def test_setKeysMACs(self):

    key = ('\x00' * 64)
    for (macName, mod) in transport.SSHCiphers.macMap.items():
        outMac = transport.SSHCiphers('none', 'none', macName, 'none')
        inMac = transport.SSHCiphers('none', 'none', 'none', macName)
        outMac.setKeys('', '', '', '', key, '')
        inMac.setKeys('', '', '', '', '', key)
        if mod:
            ds = mod().digest_size
        else:
            ds = 0
        self.assertEqual(inMac.verifyDigestSize, ds)
        if mod:
            (mod, i, o, ds) = outMac._getMAC(macName, key)
        seqid = 0
        data = key
        packet = (('\x00' * 4) + key)
        if mod:
            mac = mod((o + mod((i + packet)).digest())).digest()
        else:
            mac = ''
        self.assertEqual(outMac.makeMAC(seqid, data), mac)
        self.assertTrue(inMac.verify(seqid, data, mac))
