X-Git-Url: https://jxself.org/git/?p=skeinsum.git;a=blobdiff_plain;f=SHA3api_ref.c;h=cab5c69f9ac5b08c79ebd881aedbc1dc384fb3c8;hp=e5b589fd31fe04e07a1111e5b58cb9a3d273a7e6;hb=aff2ef43197ec56ae8cef81325229925454e09c7;hpb=225580b92ee570c3a0a7f924250dd11b36095124 diff --git a/SHA3api_ref.c b/SHA3api_ref.c index e5b589f..cab5c69 100644 --- a/SHA3api_ref.c +++ b/SHA3api_ref.c @@ -11,6 +11,14 @@ #include /* get the memcpy/memset functions */ #include "skein.h" /* get the Skein API definitions */ #include "SHA3api_ref.h"/* get the AHS API definitions */ + +//#define SKEIN_DEBUG 1 +#ifdef SKEIN_DEBUG +# include +# include +# include +#endif + /******************************************************************/ /* AHS API code */ @@ -110,6 +118,17 @@ HashReturn Hash(int hashbitlen, const BitSequence *data, /* all-in-one call */ { /* these calls do not fail when called properly */ r = Update(&state,data,databitlen); Final(&state,hashval); +#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 } return r; }