Changeset 37 for trunk


Ignore:
Timestamp:
02/13/13 19:59:42 (12 years ago)
Author:
tmorgan
Message:

fixed problem with decrypt function when starting with partially completed decryption

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/bletchley/CBC/__init__.py

    r36 r37  
    270270       
    271271        # Start where we left off last
    272         # XXX: test this
     272        # XXX: test this more
    273273        else:
    274274            num_partial = len(self.decrypted) % self.block_size
     
    277277            decrypted = self.decrypted[num_partial:]
    278278
    279             for i in range(-1-finished_blocks, 0, -1):
    280                 decrypted = self.decrypt_block(blocks[i-1], blocks[i], partial)
     279            for i in range(len(blocks)-1-finished_blocks, 0, -1):
     280                decrypted = self.decrypt_block(blocks[i-1], blocks[i], partial) + decrypted
    281281                partial = ''
    282 
     282               
    283283            # Finally decrypt first block
    284284            decrypted = self.decrypt_block(self._iv, blocks[0]) + decrypted
Note: See TracChangeset for help on using the changeset viewer.