Importing skeinsum
[skeinsum.git] / skein_debug.h
1 #ifndef _SKEIN_DEBUG_H_\r
2 #define _SKEIN_DEBUG_H_\r
3 /***********************************************************************\r
4 **\r
5 ** Interface definitions for Skein hashing debug output.\r
6 **\r
7 ** Source code author: Doug Whiting, 2008.\r
8 **\r
9 ** This algorithm and source code is released to the public domain.\r
10 **\r
11 ************************************************************************/\r
12 \r
13 #ifdef  SKEIN_DEBUG\r
14 /* callout functions used inside Skein code */\r
15 void    Skein_Show_Block(uint_t bits,const Skein_Ctxt_Hdr_t *h,const u64b_t *X,const u08b_t *blkPtr,\r
16                          const u64b_t *wPtr,const u64b_t *ksPtr,const u64b_t *tsPtr);\r
17 void    Skein_Show_Round(uint_t bits,const Skein_Ctxt_Hdr_t *h,size_t r,const u64b_t *X);\r
18 void    Skein_Show_R_Ptr(uint_t bits,const Skein_Ctxt_Hdr_t *h,size_t r,const u64b_t *X_ptr[]);\r
19 void    Skein_Show_Final(uint_t bits,const Skein_Ctxt_Hdr_t *h,size_t cnt,const u08b_t *outPtr);\r
20 void    Skein_Show_Key  (uint_t bits,const Skein_Ctxt_Hdr_t *h,const u08b_t *key,size_t keyBytes);\r
21 \r
22 extern  uint_t skein_DebugFlag;            /* flags to control debug output (0 --> none) */\r
23 \r
24 #define SKEIN_RND_SPECIAL       (1000u)\r
25 #define SKEIN_RND_KEY_INITIAL   (SKEIN_RND_SPECIAL+0u)\r
26 #define SKEIN_RND_KEY_INJECT    (SKEIN_RND_SPECIAL+1u)\r
27 #define SKEIN_RND_FEED_FWD      (SKEIN_RND_SPECIAL+2u)\r
28 \r
29 /* flag bits:  skein_DebugFlag */\r
30 #define SKEIN_DEBUG_KEY         (1u << 1)  /* show MAC key */\r
31 #define SKEIN_DEBUG_CONFIG      (1u << 2)  /* show config block processing */\r
32 #define SKEIN_DEBUG_STATE       (1u << 3)  /* show input state during Show_Block() */\r
33 #define SKEIN_DEBUG_TWEAK       (1u << 4)  /* show input state during Show_Block() */\r
34 #define SKEIN_DEBUG_KEYSCHED    (1u << 5)  /* show expanded key schedule */\r
35 #define SKEIN_DEBUG_INPUT_64    (1u << 6)  /* show input block as 64-bit words */\r
36 #define SKEIN_DEBUG_INPUT_08    (1u << 7)  /* show input block as  8-bit bytes */\r
37 #define SKEIN_DEBUG_INJECT      (1u << 8)  /* show state after key injection & feedforward points */\r
38 #define SKEIN_DEBUG_ROUNDS      (1u << 9)  /* show state after all rounds */\r
39 #define SKEIN_DEBUG_FINAL       (1u <<10)  /* show final output of Skein */\r
40 #define SKEIN_DEBUG_HDR         (1u <<11)  /* show block header */\r
41 #define SKEIN_DEBUG_THREEFISH   (1u <<12)  /* use Threefish name instead of Skein */\r
42 #define SKEIN_DEBUG_PERMUTE     (1u <<13)  /* use word permutations */\r
43 #define SKEIN_DEBUG_ALL         ((~0u) & ~(SKEIN_DEBUG_THREEFISH | SKEIN_DEBUG_PERMUTE))\r
44 #define THREEFISH_DEBUG_ALL     (SKEIN_DEBUG_ALL | SKEIN_DEBUG_THREEFISH)\r
45 \r
46 #endif /*  SKEIN_DEBUG    */\r
47 \r
48 #endif /* _SKEIN_DEBUG_H_ */\r