diff --git a/README.md b/README.md index 7502176..bdb6ecf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# nsha1 +# Not sha1 This was a failed attempt to create SHA1 algorithm in C. The algorithm achieved still seems sensitive to small changes in text files. So maybe it can be used in stuff like VCS and build systems. @@ -18,6 +18,6 @@ python3 flow clean The "library" is only adding: -1. NSHA1_Result strcut to store result +1. NSHA1_Result struct to store result 2. nsha1file, a function to get nsha1 of a file. 3. leftRotate32, a macro to circular shift 32 bit unsigned integers. \ No newline at end of file diff --git a/nsha1.h b/nsha1.h index ab3a0c4..8f1bb55 100644 --- a/nsha1.h +++ b/nsha1.h @@ -44,8 +44,6 @@ NSHA1_Result nsha1file(char *filename){ bytes_read = fread(buffer, 1, 64, file); number_of_chuncks++; - // printf("We read %d bytes\n", bytes_read); - if(bytes_read != 64){ // * We need to convert to 512 bit * // size_in_bytes += bytes_read; // the final size is done here @@ -66,14 +64,6 @@ NSHA1_Result nsha1file(char *filename){ lastRound = 1; // This is the last round } - - /** - // Printing each byte of the chunk - printf("------------------------------------------\n"); - for(int i = 0; i < 64; i++) - printf("%x i=%d\n", buffer[i], i); - printf("------------------------------------------\n"); - **/ // * We usually get a 512 bit chunk except the last chunck which we need to pad (which we do in the if above) * // size_in_bytes += 64; @@ -85,15 +75,6 @@ NSHA1_Result nsha1file(char *filename){ for(int i = 16; i < 80; i++) w[i] = leftRotate32( w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i - 16] , 1 ); - - - /** - // Printing each w for the chunck - printf("------------------------------------------\n"); - for(int i = 0; i < 80; i++) - printf("%x i=%d\n", w[i], i); - printf("------------------------------------------\n"); - **/ uint32_t a = h0; uint32_t b = h1;