X-Git-Url: https://jxself.org/git/?p=skeinsum.git;a=blobdiff_plain;f=SHA3api_ref.c;h=19858c1d895eed8b94b39742e4be62263d68e440;hp=e5b589fd31fe04e07a1111e5b58cb9a3d273a7e6;hb=ae618fc884d1b2741e63fc7fc7e9e79f1627f3a5;hpb=65919886f95d5e68de916da1d20aad7e2a135ff4 diff --git a/SHA3api_ref.c b/SHA3api_ref.c index e5b589f..19858c1 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 */ @@ -111,5 +119,16 @@ HashReturn Hash(int hashbitlen, const BitSequence *data, /* all-in-one call */ r = Update(&state,data,databitlen); Final(&state,hashval); } +#ifdef SKEIN_DEBUG + if (r == SUCCESS && getenv("SKEIN_DEEP_DUMP")) + { + printf("==== Hashbitlen = %d, DataBitLen = %llu, Data:\n%s\n==== Hash:\n", + hashbitlen, (long long unsigned)databitlen, (const char*)data); + int i; + for (i = 0; i < hashbitlen / 8; i++) + printf("%02X", hashval[i]); + } + printf("\n"); +#endif return r; }