Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. std::vector<uint8_t> modify_block(const std::vector<uint8_t> ciphertext, uint64_t blocknumer, uint16_t delta){
  2. std::vector<uint8_t>::const_iterator first = ciphertext.begin() + blocknumer*sha1::block_size;
  3. std::vector<uint8_t>::const_iterator last = ciphertext.begin() + (blocknumer+1)*sha1::block_size;
  4. std::vector<uint8_t> block(first, last);
  5.  
  6.  
  7. block[block.size()-2] = block[block.size()-2] ^ delta;
  8. block[block.size()-1] = block[block.size()-1] ^ delta;
  9.  
  10. return block;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement