diff --git a/Implementierung/src/io.c b/Implementierung/src/io.c index 942f235..3dbc7ff 100644 --- a/Implementierung/src/io.c +++ b/Implementierung/src/io.c @@ -35,8 +35,7 @@ uint8_t* read_file(const char* path, size_t* size) { uint8_t* data = malloc(statOfFile.st_size); if (data == NULL) { - printf("Failure: malloc returns NULL"); - return EXIT_FAILURE; + return; } size_t bytesRead = diff --git a/Implementierung/src/main.c b/Implementierung/src/main.c index 42b8e6f..f4e5fc8 100644 --- a/Implementierung/src/main.c +++ b/Implementierung/src/main.c @@ -1,4 +1,5 @@ #include +#include #include "../lib/helper.h" #include "../lib/io.h" diff --git a/Implementierung/src/md2_impls/md2_0.c b/Implementierung/src/md2_impls/md2_0.c index 941b352..93b7dee 100644 --- a/Implementierung/src/md2_impls/md2_0.c +++ b/Implementierung/src/md2_impls/md2_0.c @@ -26,8 +26,7 @@ void md2_hash_0(size_t len, const uint8_t buf[len], uint8_t out[16]) { // +16 for the checksum uint8_t* newBuf = calloc(len + 16, sizeof(uint8_t)); if (newBuf == NULL) { - printf("Failure: calloc returns NULL"); - return EXIT_FAILURE; + return; } memcpy(newBuf, buf, len - paddingNeeded); @@ -49,8 +48,7 @@ void md2_hash_0(size_t len, const uint8_t buf[len], uint8_t out[16]) { // === step 3 === uint8_t* messageDigestBuf = calloc(48, sizeof(uint8_t)); if (messageDigestBuf == NULL) { - printf("Failure: calloc returns NULL"); - return EXIT_FAILURE; + return; } diff --git a/Implementierung/src/md2_impls/md2_1.c b/Implementierung/src/md2_impls/md2_1.c index d4fb80b..ac1d867 100644 --- a/Implementierung/src/md2_impls/md2_1.c +++ b/Implementierung/src/md2_impls/md2_1.c @@ -47,8 +47,7 @@ void md2_hash_1(size_t len, const uint8_t buf[len], uint8_t out[16]) uint8_t* newBuf = aligned_alloc(16, sizeof(uint8_t)*(len + 16)); if (newBuf == NULL) { - printf("Failure: aligned_alloc returns NULL"); - return EXIT_FAILURE; + return; } for(size_t i = 0; i < 16; i++) { @@ -65,8 +64,7 @@ void md2_hash_1(size_t len, const uint8_t buf[len], uint8_t out[16]) // === step 3 === uint8_t *messageDigestBuf = aligned_alloc(16, sizeof(uint8_t) * 48); if (messageDigestBuf == NULL) { - printf("Failure: aligned_alloc returns NULL"); - return EXIT_FAILURE; + return; } for (size_t i = 0; i < 48; i++) { diff --git a/Implementierung/src/md2_impls/md2_2.c b/Implementierung/src/md2_impls/md2_2.c index 5253ce7..279af73 100644 --- a/Implementierung/src/md2_impls/md2_2.c +++ b/Implementierung/src/md2_impls/md2_2.c @@ -51,8 +51,7 @@ void md2_hash_2(size_t len, const uint8_t buf[len], uint8_t out[16]) { // === step 3 === uint8_t* messageDigestBuf = calloc(48, sizeof(uint8_t)); if (messageDigestBuf == NULL) { - printf("Failure: calloc returns NULL"); - return EXIT_FAILURE; + return; } // === step 4 ===