def feed(self, data = None):
        '''Provide bytes to encrypt (or decrypt), returning any bytes
           possible from this or any previous calls to feed.

           Call with None or an empty string to flush the mode of
           operation and return any final bytes; no further calls to
           feed may be made.'''

        if self._buffer is None:
            raise ValueError('already finished feeder')

        # Finalize; process the spare bytes we were keeping
        if not data:
            result = self._final(self._buffer, self._padding)
            self._buffer = None
            return result

        self._buffer += to_bufferable(data)

        # We keep 16 bytes around so we can determine padding
        result = to_bufferable('')
        while len(self._buffer) > 16:
            can_consume = self._mode._can_consume(len(self._buffer) - 16)
            if can_consume == 0: break
            result += self._feed(self._buffer[:can_consume])
            self._buffer = self._buffer[can_consume:]

        return result
def feed ( self , data = None ) : if self . _buffer is None : raise ValueError ( 'already finished feeder' ) if not data : result = self . _final ( self . _buffer , self . _padding ) self . _buffer = None return result self . _buffer += to_bufferable ( data ) result = to_bufferable ( '' ) while len ( self . _buffer ) > 16 : can_consume = self . _mode . _can_consume ( len ( self . _buffer ) - 16 ) if can_consume == 0 : break result += self . _feed ( self . _buffer [ : can_consume ] ) self . _buffer = self . _buffer [ can_consume : ] return result
Provide bytes to encrypt (or decrypt), returning any bytes
           possible from this or any previous calls to feed.

           Call with None or an empty string to flush the mode of
           operation and return any final bytes; no further calls to
           feed may be made.