return (NotProper || NoMatch) ? -1 : 1;
}
+void PrintStringHash(const char *s)
+{
+ unsigned char output[hashbitlen/4];
+ char digest[hashbitlen/4 + 1];
+ Hash(hashbitlen, s, strlen(s), output);
+ hash2hexstr(output, digest);
+ printf("%s -%s\n", digest, s);
+}
+
void print_version(void)
{
printf("skein%dsum 1.0\n", hashbitlen);
WARN("command line should contain strings for hashing\n");
TRYHELP_GOODBYE();
}
- for( ; n < argc; n++) {
- unsigned char output[hashbitlen/4];
- char digest[hashbitlen/4 + 1];
- Hash(hashbitlen, argv[n], strlen(argv[n]), output);
- hash2hexstr(output, digest);
- printf("%s -%s\n", digest, argv[n]);
- }
+ while (n < argc)
+ PrintStringHash(argv[n++]);
return 0;
}