Hex Artifact Content
Not logged in

Artifact acb9a865fb633156ed65b2b7cc8649b6e25dfc7f:


0000: 2f 2a 0a 54 68 65 20 4b 65 63 63 61 6b 20 73 70  /*.The Keccak sp
0010: 6f 6e 67 65 20 66 75 6e 63 74 69 6f 6e 2c 20 64  onge function, d
0020: 65 73 69 67 6e 65 64 20 62 79 20 47 75 69 64 6f  esigned by Guido
0030: 20 42 65 72 74 6f 6e 69 2c 20 4a 6f 61 6e 20 44   Bertoni, Joan D
0040: 61 65 6d 65 6e 2c 0a 4d 69 63 68 61 c3 ab 6c 20  aemen,.Michaël 
0050: 50 65 65 74 65 72 73 20 61 6e 64 20 47 69 6c 6c  Peeters and Gill
0060: 65 73 20 56 61 6e 20 41 73 73 63 68 65 2e 20 46  es Van Assche. F
0070: 6f 72 20 6d 6f 72 65 20 69 6e 66 6f 72 6d 61 74  or more informat
0080: 69 6f 6e 2c 20 66 65 65 64 62 61 63 6b 20 6f 72  ion, feedback or
0090: 0a 71 75 65 73 74 69 6f 6e 73 2c 20 70 6c 65 61  .questions, plea
00a0: 73 65 20 72 65 66 65 72 20 74 6f 20 6f 75 72 20  se refer to our 
00b0: 77 65 62 73 69 74 65 3a 20 68 74 74 70 3a 2f 2f  website: http://
00c0: 6b 65 63 63 61 6b 2e 6e 6f 65 6b 65 6f 6e 2e 6f  keccak.noekeon.o
00d0: 72 67 2f 0a 0a 49 6d 70 6c 65 6d 65 6e 74 61 74  rg/..Implementat
00e0: 69 6f 6e 20 62 79 20 74 68 65 20 64 65 73 69 67  ion by the desig
00f0: 6e 65 72 73 2c 0a 68 65 72 65 62 79 20 64 65 6e  ners,.hereby den
0100: 6f 74 65 64 20 61 73 20 22 74 68 65 20 69 6d 70  oted as "the imp
0110: 6c 65 6d 65 6e 74 65 72 22 2e 0a 0a 54 6f 20 74  lementer"...To t
0120: 68 65 20 65 78 74 65 6e 74 20 70 6f 73 73 69 62  he extent possib
0130: 6c 65 20 75 6e 64 65 72 20 6c 61 77 2c 20 74 68  le under law, th
0140: 65 20 69 6d 70 6c 65 6d 65 6e 74 65 72 20 68 61  e implementer ha
0150: 73 20 77 61 69 76 65 64 20 61 6c 6c 20 63 6f 70  s waived all cop
0160: 79 72 69 67 68 74 0a 61 6e 64 20 72 65 6c 61 74  yright.and relat
0170: 65 64 20 6f 72 20 6e 65 69 67 68 62 6f 72 69 6e  ed or neighborin
0180: 67 20 72 69 67 68 74 73 20 74 6f 20 74 68 65 20  g rights to the 
0190: 73 6f 75 72 63 65 20 63 6f 64 65 20 69 6e 20 74  source code in t
01a0: 68 69 73 20 66 69 6c 65 2e 0a 68 74 74 70 3a 2f  his file..http:/
01b0: 2f 63 72 65 61 74 69 76 65 63 6f 6d 6d 6f 6e 73  /creativecommons
01c0: 2e 6f 72 67 2f 70 75 62 6c 69 63 64 6f 6d 61 69  .org/publicdomai
01d0: 6e 2f 7a 65 72 6f 2f 31 2e 30 2f 0a 2a 2f 0a 0a  n/zero/1.0/.*/..
01e0: 23 69 66 6e 64 65 66 20 5f 64 69 73 70 6c 61 79  #ifndef _display
01f0: 49 6e 74 65 72 6d 65 64 69 61 74 65 56 61 6c 75  IntermediateValu
0200: 65 73 5f 68 5f 0a 23 64 65 66 69 6e 65 20 5f 64  es_h_.#define _d
0210: 69 73 70 6c 61 79 49 6e 74 65 72 6d 65 64 69 61  isplayIntermedia
0220: 74 65 56 61 6c 75 65 73 5f 68 5f 0a 0a 23 69 6e  teValues_h_..#in
0230: 63 6c 75 64 65 20 3c 73 74 64 69 6f 2e 68 3e 0a  clude <stdio.h>.
0240: 0a 76 6f 69 64 20 64 69 73 70 6c 61 79 53 65 74  .void displaySet
0250: 49 6e 74 65 72 6d 65 64 69 61 74 65 56 61 6c 75  IntermediateValu
0260: 65 46 69 6c 65 28 46 49 4c 45 20 2a 66 29 3b 0a  eFile(FILE *f);.
0270: 76 6f 69 64 20 64 69 73 70 6c 61 79 53 65 74 4c  void displaySetL
0280: 65 76 65 6c 28 69 6e 74 20 6c 65 76 65 6c 29 3b  evel(int level);
0290: 0a 76 6f 69 64 20 64 69 73 70 6c 61 79 42 79 74  .void displayByt
02a0: 65 73 28 69 6e 74 20 6c 65 76 65 6c 2c 20 63 6f  es(int level, co
02b0: 6e 73 74 20 63 68 61 72 20 2a 74 65 78 74 2c 20  nst char *text, 
02c0: 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 63  const unsigned c
02d0: 68 61 72 20 2a 62 79 74 65 73 2c 20 75 6e 73 69  har *bytes, unsi
02e0: 67 6e 65 64 20 69 6e 74 20 73 69 7a 65 29 3b 0a  gned int size);.
02f0: 76 6f 69 64 20 64 69 73 70 6c 61 79 42 69 74 73  void displayBits
0300: 28 69 6e 74 20 6c 65 76 65 6c 2c 20 63 6f 6e 73  (int level, cons
0310: 74 20 63 68 61 72 20 2a 74 65 78 74 2c 20 63 6f  t char *text, co
0320: 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 63 68 61  nst unsigned cha
0330: 72 20 2a 64 61 74 61 2c 20 75 6e 73 69 67 6e 65  r *data, unsigne
0340: 64 20 69 6e 74 20 73 69 7a 65 2c 20 69 6e 74 20  d int size, int 
0350: 4d 53 42 66 69 72 73 74 29 3b 0a 76 6f 69 64 20  MSBfirst);.void 
0360: 64 69 73 70 6c 61 79 53 74 61 74 65 41 73 42 79  displayStateAsBy
0370: 74 65 73 28 69 6e 74 20 6c 65 76 65 6c 2c 20 63  tes(int level, c
0380: 6f 6e 73 74 20 63 68 61 72 20 2a 74 65 78 74 2c  onst char *text,
0390: 20 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20   const unsigned 
03a0: 63 68 61 72 20 2a 73 74 61 74 65 29 3b 0a 76 6f  char *state);.vo
03b0: 69 64 20 64 69 73 70 6c 61 79 53 74 61 74 65 41  id displayStateA
03c0: 73 33 32 62 69 74 57 6f 72 64 73 28 69 6e 74 20  s32bitWords(int 
03d0: 6c 65 76 65 6c 2c 20 63 6f 6e 73 74 20 63 68 61  level, const cha
03e0: 72 20 2a 74 65 78 74 2c 20 63 6f 6e 73 74 20 75  r *text, const u
03f0: 6e 73 69 67 6e 65 64 20 69 6e 74 20 2a 73 74 61  nsigned int *sta
0400: 74 65 29 3b 0a 76 6f 69 64 20 64 69 73 70 6c 61  te);.void displa
0410: 79 53 74 61 74 65 41 73 36 34 62 69 74 57 6f 72  yStateAs64bitWor
0420: 64 73 28 69 6e 74 20 6c 65 76 65 6c 2c 20 63 6f  ds(int level, co
0430: 6e 73 74 20 63 68 61 72 20 2a 74 65 78 74 2c 20  nst char *text, 
0440: 63 6f 6e 73 74 20 75 6e 73 69 67 6e 65 64 20 6c  const unsigned l
0450: 6f 6e 67 20 6c 6f 6e 67 20 69 6e 74 20 2a 73 74  ong long int *st
0460: 61 74 65 29 3b 0a 76 6f 69 64 20 64 69 73 70 6c  ate);.void displ
0470: 61 79 52 6f 75 6e 64 4e 75 6d 62 65 72 28 69 6e  ayRoundNumber(in
0480: 74 20 6c 65 76 65 6c 2c 20 75 6e 73 69 67 6e 65  t level, unsigne
0490: 64 20 69 6e 74 20 69 29 3b 0a 76 6f 69 64 20 64  d int i);.void d
04a0: 69 73 70 6c 61 79 54 65 78 74 28 69 6e 74 20 6c  isplayText(int l
04b0: 65 76 65 6c 2c 20 63 6f 6e 73 74 20 63 68 61 72  evel, const char
04c0: 20 2a 74 65 78 74 29 3b 0a 0a 23 65 6e 64 69 66   *text);..#endif
04d0: 0a                                               .