'Set AES\' session key and the initialisation vector for counter mode.
The given `key\' and `iv\' are used as 256-bit AES key and as 128-bit
initialisation vector for counter mode.  Both, the key as well as the
IV must come from a CSPRNG.'

def setSessionKey(self, key, iv):

    self.sessionKey = key
    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)
