diff --git a/example.c b/example.c index b0764f7..3908832 100644 --- a/example.c +++ b/example.c @@ -3,8 +3,8 @@ #include int main(){ - NSHA1_Result r = nsha1file("flow"); + NSHA1_Result r = nsha1file("test"); 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; } diff --git a/nsha1.h b/nsha1.h index 098d0d3..838d414 100644 --- a/nsha1.h +++ b/nsha1.h @@ -5,7 +5,9 @@ #include #include -#define leftRotate32(N,D) (N<>(32-D)) +uint32_t leftRotate32( uint32_t N, uint32_t D){ + return ((N << D) | (N >> (32-D))); +} typedef struct NSHA1_Result{ uint32_t h0; diff --git a/test b/test new file mode 100644 index 0000000..5e1c309 --- /dev/null +++ b/test @@ -0,0 +1 @@ +Hello World \ No newline at end of file