Created
August 14, 2014 13:55
-
-
Save nyux/3f51c7840ce8bdf111d4 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 <stdio.h> | |
#include <stdlib.h> | |
#include <gmp.h> | |
/* remember: compile with -lgmp flag */ | |
int main(void) | |
{ | |
char *hex1 = "1c0111001f010100061a024b53535009181c"; | |
char *hex2 = "686974207468652062756c6c277320657965"; | |
mpz_t hexval1, hexval2, result; | |
mpz_init_set_str(hexval1, hex1, 16); | |
mpz_init_set_str(hexval2, hex2, 16); | |
mpz_init(result); | |
mpz_xor(result, hexval1, hexval2); | |
gmp_printf("%Zx\n", result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment