SHA256Reset.c.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version='1.0' encoding='iso-8859-1'?>
  2. <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
  4. <head>
  5. <title>
  6. SHA256Reset.c
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
  10. <meta name='author' content='cmaier@cmassoc.net'/>
  11. <meta name='robots' content='noindex,nofollow'/>
  12. <link href='toolkit.css' rel='stylesheet' type='text/css'/>
  13. </head>
  14. <body>
  15. <div class='headerlink'>
  16. [<a href='SHA256Print.c.html' title=' SHA256Print.c '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='SHA256Write.c.html' title=' SHA256Write.c '>NEXT</a>]
  19. </div>
  20. <pre>
  21. /*====================================================================*
  22. *
  23. * SHA256Reset (struct sha256 * sha256)
  24. *
  25. * SHA256.h
  26. *
  27. * initialize the SHA256 hash state; this effectively erases the
  28. * previous hash state;
  29. *
  30. * Read standard FIPS180-2 sec 5.3.2 for an explanation;
  31. *
  32. * Motley Tools by Charles Maier &lt;cmaier@cmassoc.net&gt;;
  33. * Copyright (c) 2001-2006 by Charles Maier Associates;
  34. * Licensed under the Internet Software Consortium License;
  35. *
  36. *--------------------------------------------------------------------*/
  37. #ifndef SHA256RESET_SOURCE
  38. #define SHA256RESET_SOURCE
  39. #include &quot;../key/SHA256.h&quot;
  40. void SHA256Reset (struct sha256 * sha256)
  41. {
  42. memset (sha256, 0, sizeof (struct sha256));
  43. sha256-&gt;state [0] = 0x6A09E667;
  44. sha256-&gt;state [1] = 0xBB67AE85;
  45. sha256-&gt;state [2] = 0x3C6EF372;
  46. sha256-&gt;state [3] = 0xA54FF53A;
  47. sha256-&gt;state [4] = 0x510E527F;
  48. sha256-&gt;state [5] = 0x9B05688C;
  49. sha256-&gt;state [6] = 0x1F83D9AB;
  50. sha256-&gt;state [7] = 0x5BE0CD19;
  51. sha256-&gt;extra [0] = 0x80;
  52. return;
  53. }
  54. #endif
  55. </pre>
  56. <div class='footerlink'>
  57. [<a href='SHA256Print.c.html' title=' SHA256Print.c '>PREV</a>]
  58. [<a href='toolkit.html' title=' Index '>HOME</a>]
  59. [<a href='SHA256Write.c.html' title=' SHA256Write.c '>NEXT</a>]
  60. </div>
  61. </body>
  62. </html>