Add home page and email address to help output
[skeinsum.git] / SHA3api_ref.c
index e5b589fd31fe04e07a1111e5b58cb9a3d273a7e6..cab5c69f9ac5b08c79ebd881aedbc1dc384fb3c8 100644 (file)
 #include <string.h>     /* get the memcpy/memset functions */\r
 #include "skein.h"      /* get the Skein API definitions   */\r
 #include "SHA3api_ref.h"/* get the  AHS  API definitions   */\r
+
+//#define SKEIN_DEBUG 1
+#ifdef SKEIN_DEBUG
+#  include <stdio.h>
+#  include <stdlib.h>
+#  include <string.h>
+#endif
+
 \r
 /******************************************************************/\r
 /*     AHS API code                                               */\r
@@ -110,6 +118,17 @@ HashReturn Hash(int hashbitlen, const BitSequence *data, /* all-in-one call */
         { /* these calls do not fail when called properly */\r
         r = Update(&state,data,databitlen);\r
         Final(&state,hashval);\r
+#ifdef SKEIN_DEBUG
+        if (r == SUCCESS && getenv("SKEIN_DEEP_DUMP"))
+            {
+            int i;
+            printf("==== Hashbitlen = %d, DataBitLen = %llu, Data:\n%s\n==== Hash:\n",
+                hashbitlen, (long long unsigned)databitlen, (const char*)data);
+            for (i = 0; i < hashbitlen / 8; i++)
+                printf("%02X", hashval[i]);
+            printf("\n");
+            }
+#endif
         }\r
     return r;\r
     }\r