Don't Reinvent The Wheel use proven code instead of rewriting Nitendo Wii... they didn't use a standard SHA1 implementation. instead... strncmp(sha1_sig, sha1_in, 20); works well when I feed it a signature that starts with null bytes know your APIs - strings in C are null terminated, sha1 checksums are not strings