}
ctx->off = 0;
ctx->nl = U32(count);
- ctx->nh = U32(((count & ~MASK32) >> 16) >> 16);
+ ctx->nh = U32(((count & ~(unsigned long)MASK32) >> 16) >> 16);
}
/* --- @whirlpool_hash@, @whirlpool256_hash@ --- *
/* --- Generic interface --- */
-GHASH_DEF(WHIRLPOOL, whirlpool)
+#define HASHES(_) \
+ _(WHIRLPOOL, whirlpool) \
+ _(WHIRLPOOL256, whirlpool256)
-/* --- Test code --- */
+HASHES(GHASH_DEF)
-HASH_TEST(WHIRLPOOL, whirlpool)
+/*----- Test rig ----------------------------------------------------------*/
+
+#ifdef TEST_RIG
+
+#include <mLib/testrig.h>
+
+HASHES(HASH_VERIFY)
+
+static const test_chunk defs[] = {
+ HASHES(HASH_TESTDEFS)
+ { 0, 0, { 0 } }
+};
+
+int main(int argc, char *argv[])
+{
+ test_run(argc, argv, defs, SRCDIR "/t/whirlpool");
+ return (0);
+}
+
+#endif
/*----- That's all, folks -------------------------------------------------*/