fix tests
This commit is contained in:
parent
70bb4644e2
commit
60e2715e19
|
@ -264,4 +264,4 @@ const unsigned char* repeating_key_xor(const unsigned char* s, size_t s_sz, cons
|
||||||
|
|
||||||
const unsigned char *repeating_key_xor_s(const char* s, const char* key) {
|
const unsigned char *repeating_key_xor_s(const char* s, const char* key) {
|
||||||
return repeating_key_xor((unsigned char*)s, strlen(s), (unsigned char*)key, strlen(key));
|
return repeating_key_xor((unsigned char*)s, strlen(s), (unsigned char*)key, strlen(key));
|
||||||
}
|
}
|
||||||
|
|
|
@ -350,7 +350,7 @@ void test_crypto() {
|
||||||
free(s);
|
free(s);
|
||||||
|
|
||||||
s = hex_encode(h, 4);
|
s = hex_encode(h, 4);
|
||||||
assert(strcmp(s, "DEADBEEF") == 0);
|
assert(strcmp(s, "deadbeef") == 0);
|
||||||
free(s);
|
free(s);
|
||||||
|
|
||||||
// "Sup?"
|
// "Sup?"
|
||||||
|
@ -363,7 +363,7 @@ void test_crypto() {
|
||||||
|
|
||||||
s = repeating_key_xor_s("TEST", "HI");
|
s = repeating_key_xor_s("TEST", "HI");
|
||||||
const char *enc = hex_encode(s, 4);
|
const char *enc = hex_encode(s, 4);
|
||||||
assert(strcmp(enc, "1C0C1B1D") == 0);
|
assert(strcmp(enc, "1c0c1b1d") == 0);
|
||||||
free(enc);
|
free(enc);
|
||||||
free(s);
|
free(s);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue