Holy Shit it Works

It was the goddamn leftrotate32 macro.
main
lomna-dev 1 year ago
parent 4643c57720
commit c5758a18b7

@ -3,8 +3,8 @@
#include <stdint.h> #include <stdint.h>
int main(){ int main(){
NSHA1_Result r = nsha1file("flow"); NSHA1_Result r = nsha1file("test");
char buffer[41]; char buffer[41];
printf("%x %x %x %x %x", r.h0, r.h1, r.h2, r.h3, r.h4); printf("%x%x%x%x%x", r.h0, r.h1, r.h2, r.h3, r.h4);
return 0; return 0;
} }

@ -5,7 +5,9 @@
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#define leftRotate32(N,D) (N<<D)|(N>>(32-D)) uint32_t leftRotate32( uint32_t N, uint32_t D){
return ((N << D) | (N >> (32-D)));
}
typedef struct NSHA1_Result{ typedef struct NSHA1_Result{
uint32_t h0; uint32_t h0;

@ -0,0 +1 @@
Hello World
Loading…
Cancel
Save