31 lines
521 B
C
31 lines
521 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
#include <openssl/md5.h>
|
||
|
|
||
|
void compute_md5(char *str, unsigned char digest[16]) {
|
||
|
MD5Context ctx;
|
||
|
MD5_Init(&ctx);
|
||
|
MD5_Update(&ctx, str, strlen(str));
|
||
|
MD5_Final(digest, &ctx);
|
||
|
}
|
||
|
|
||
|
void part1() {
|
||
|
unsigned char digest[16];
|
||
|
compute_md5("asdf", digest);
|
||
|
}
|
||
|
|
||
|
void part2() {
|
||
|
}
|
||
|
|
||
|
int main(int argc, char **argv) {
|
||
|
int doPart = 1;
|
||
|
if(argc > 1) { doPart = argv[1][0] - '0'; }
|
||
|
if(doPart == 1) {
|
||
|
part1();
|
||
|
} else {
|
||
|
part2();
|
||
|
}
|
||
|
return 0;
|
||
|
}
|