You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

14 line
374 B

  1. #include <string.h>
  2. void xor_repeatedly(const unsigned char* const i_xor, const unsigned i_xor_len, const unsigned char* const i_string, const unsigned i_string_len, unsigned char* o_xored)
  3. {
  4. unsigned counter = 0;
  5. while( counter < i_string_len )
  6. {
  7. unsigned xor_idx = counter % i_xor_len;
  8. o_xored[counter] = (i_string[counter]) ^ (i_xor[xor_idx]);
  9. counter++;
  10. }
  11. }