From b8f9f6f24713e91c948e4acbcadad4c56021fa5c Mon Sep 17 00:00:00 2001 From: x1phosura Date: Wed, 27 Apr 2022 00:43:03 -0700 Subject: [PATCH] Realize my 'fixed' XOR is already repeating-key --- set1/src/{fixed-xor.c => repeating-key-xor.c} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename set1/src/{fixed-xor.c => repeating-key-xor.c} (76%) diff --git a/set1/src/fixed-xor.c b/set1/src/repeating-key-xor.c similarity index 76% rename from set1/src/fixed-xor.c rename to set1/src/repeating-key-xor.c index 9ff90ff..70a924f 100644 --- a/set1/src/fixed-xor.c +++ b/set1/src/repeating-key-xor.c @@ -3,13 +3,13 @@ #include /* -void fixed_xor_stream(uint8_t *key, size_t key_len) +void repeating_key_xor_stream(uint8_t *key, size_t key_len) { // } */ -void fixed_xor(const uint8_t *data, const size_t data_len, +void repeating_key_xor(const uint8_t *data, const size_t data_len, const uint8_t *key, const size_t key_len) { uint8_t c; @@ -30,7 +30,7 @@ int main() uint8_t key[] = "\x68\x69\x74\x20\x74\x68\x65\x20\x62\x75\x6c\x6c\x27" "\x73\x20\x65\x79\x65"; - fixed_xor(data, sizeof(data)-1, key, sizeof(key)-1); + repeating_key_xor(data, sizeof(data)-1, key, sizeof(key)-1); return EXIT_SUCCESS; }