Created
March 22, 2019 15:21
-
-
Save voronkovich/2fbe36a897e7c0704f3b261efdad914d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stddef.h> | |
#include "xor.h" | |
void *memxor(void *s, size_t ssize, void *k, size_t ksize) | |
{ | |
unsigned char *sp = s; | |
unsigned char *kp = k; | |
for (size_t i = 0; i < ssize; ++i) { | |
sp[i] ^= kp[i % ksize]; | |
} | |
return s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment