cryptopals_c

cryptopals crypto challenges solutions in pure c
git clone git://git.superpozycja.net/cryptopals_c
Log | Files | Refs | README

c2.c (297B)


      1 #include <ba.h>
      2 
      3 int main(int argc, char* argv[])
      4 {
      5 	ba* a;
      6 	ba* b;
      7 
      8 	if (argc != 3)
      9 		return -1;
     10 
     11 	a = ba_from_hex(argv[1]);
     12 	b = ba_from_hex(argv[2]);
     13 
     14 	if (a == NULL || b == NULL) {
     15 		return -1;
     16 	}
     17 
     18 	ba_xor(a, b);
     19 	ba_fprint(a, stdout, 0);
     20 	printf("\n");
     21 	ba_free(a);
     22 	ba_free(b);
     23 	return 0;
     24 }