gra-projekt/Implementierung/src/main.c

34 lines
704 B
C
Raw Normal View History

#include "helper.h"
2022-06-29 10:58:49 +02:00
#include "io.h"
#include "md2.h"
int main(int argc, char** argv) {
2022-06-29 11:12:35 +02:00
struct configuration c;
enum argumentParseResult result = parseArguments(argc, argv, &c);
2022-06-29 11:12:35 +02:00
switch (result) {
case RESULT_EXIT_SUCCESS:
2022-06-29 11:12:35 +02:00
return EXIT_SUCCESS;
case RESULT_EXIT_FAILURE:
2022-06-29 11:12:35 +02:00
return EXIT_FAILURE;
default:
2022-06-29 11:12:35 +02:00
break;
}
2022-06-29 11:12:35 +02:00
printf(
"Hashing file: %s\nUsing implementation: %d, doing benchmark: %d, "
"benchmark cycles: %d\n",
c.filename, c.implementationToUse, c.doBenchmark, c.benchmarkingCycles);
2022-06-29 15:41:56 +02:00
uint8_t out[16];
2022-06-29 16:12:09 +02:00
md2_hash(0, "", out);
printf("Hash: ");
for (int i = 0; i < 16; i++) {
printf("%02x", out[i]);
}
printf("\n");
2022-06-29 15:41:56 +02:00
2022-06-29 11:12:35 +02:00
return 0;
}