def setSessionKey( self, key, iv ):

        self.sessionKey = key

        # Our 128-bit counter has the following format:
        # [ 64-bit static and random IV ] [ 64-bit incrementing counter ]
        # Counter wrapping is not allowed which makes it possible to transfer
        # 2^64 * 16 bytes of data while avoiding counter reuse.  That amount is
        # effectively out of reach given today's networking performance.
        log.debug("Setting IV for AES-CTR.")
        self.counter = Crypto.Util.Counter.new(64,
                                               prefix = iv,
                                               initial_value = 1,
                                               allow_wraparound = False)

        log.debug("Setting session key for AES-CTR.")
        self.crypter = Crypto.Cipher.AES.new(key, Crypto.Cipher.AES.MODE_CTR,
                                             counter=self.counter)
Set AES' session key and the initialisation vector for counter mode.
dataset/ETHPy150Open isislovecruft/obfsproxy/obfsproxy/transports/scramblesuit/mycrypto.py/PayloadCrypter.setSessionKey