home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / h / hpack78s.zip / crypt / md5.h < prev    next >
C/C++ Source or Header  |  1992-09-21  |  2KB  |  57 lines

  1. /****************************************************************************
  2. *                                                                            *
  3. *                            HPACK Multi-System Archiver                        *
  4. *                            ===========================                        *
  5. *                                                                            *
  6. *                          MD5 Message Digest Code Header                    *
  7. *                              MD5.C  Updated 21/09/91                        *
  8. *                                                                            *
  9. * This program is protected by copyright and as such any use or copying of    *
  10. *  this code for your own purposes directly or indirectly is highly uncool    *
  11. *                      and if you do so there will be....trubble.                *
  12. *                 And remember: We know where your kids go to school.            *
  13. *                                                                            *
  14. *            Copyright 1991  Peter C.Gutmann.  All rights reserved            *
  15. *                                                                            *
  16. ****************************************************************************/
  17.  
  18. #ifndef _MD5_DEFINED
  19.  
  20. #define _MD5_DEFINED
  21.  
  22. #include "defs.h"
  23.  
  24. /****************************************************************************
  25. *                                                                            *
  26. *            RSA Data Security, Inc. MD5 Message-Digest Algorithm            *
  27. *  Created 2/17/90 RLR, revised 12/27/90 SRD,AJ,BSK,JT Reference C version    *
  28. *    Revised (for MD5) RLR 4/27/91: G modified to have y&~z instead of y&z,    *
  29. * FF, GG, HH modified to add in last register done, access pattern: round 2 *
  30. *    works mod 5, round 3 works mod 3, distinct additive constant for each    *
  31. *                    step round 4 added, working mod 7                        *
  32. *                                                                            *
  33. ****************************************************************************/
  34.  
  35. /* The size of an MD5 data block and the number of rounds in the MD5 transformation */
  36.  
  37. #define MD5_BLOCKSIZE    64
  38. #define MD5_ROUNDS        64
  39.  
  40. /* Data structure for MD5 computation */
  41.  
  42. typedef struct {
  43.                LONG i[ 2 ];            /* Number of bits handled mod 2^64 */
  44.                LONG buf[ 4 ];        /* Scratch buffer */
  45.                BYTE in[ MD5_BLOCKSIZE ];    /* Input buffer */
  46.                BYTE digest[ 16 ];    /* Actual digest after MD5Final() call */
  47.                } MD5_CTX;
  48.  
  49. /* Message digest functions */
  50.  
  51. void MD5SetConst( BYTE *buffer );
  52. void MD5Init( MD5_CTX *mdContext );
  53. void MD5Update( MD5_CTX *mdContext, BYTE *buffer, unsigned int noBytes );
  54. void MD5Final( MD5_CTX *mdContext );
  55.  
  56. #endif /* _MD5_DEFINED */
  57.