def verify_uniqueness():
     repository = Repository(self.repository_path)
     for key, _ in repository.open_index(repository.get_transaction_id()).iteritems():
         data = repository.get(key)
         hash = sha256(data).digest()
         if not hash in seen:
             seen.add(hash)
             num_blocks = num_aes_blocks(len(data) - 41)
             nonce = bytes_to_long(data[33:41])
             for counter in range(nonce, nonce + num_blocks):
                 self.assert_not_in(counter, used)
                 used.add(counter)
示例#2
0
 def verify_uniqueness():
     repository = Repository(self.repository_path)
     for key, _ in repository.index.iteritems():
         data = repository.get(key)
         hash = sha256(data).digest()
         if not hash in seen:
             seen.add(hash)
             num_blocks = num_aes_blocks(len(data) - 41)
             nonce = bytes_to_long(data[33:41])
             for counter in range(nonce, nonce + num_blocks):
                 self.assert_not_in(counter, used)
                 used.add(counter)