home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / radius_2.zip / md5.h < prev    next >
C/C++ Source or Header  |  1994-12-27  |  2KB  |  73 lines

  1. /* GLOBAL.H - RSAREF types and constants
  2.  */
  3.  
  4. /* PROTOTYPES should be set to one if and only if the compiler supports
  5.   function argument prototyping.
  6.   The following makes PROTOTYPES default to 0 if it has not already
  7.   been defined with C compiler flags.
  8.  */
  9. #ifndef PROTOTYPES
  10. #define PROTOTYPES 0
  11. #endif
  12.  
  13. /* POINTER defines a generic pointer type */
  14. typedef unsigned char *POINTER;
  15.  
  16. /* UINT2 defines a two byte word */
  17. typedef unsigned short int UINT2;
  18.  
  19. /* UINT4 defines a four byte word */
  20. #if defined(__alpha) && defined(__osf__)
  21. typedef unsigned int UINT4;
  22. #else
  23. typedef unsigned long int UINT4;
  24. #endif
  25.  
  26. /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
  27.    If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
  28.   returns an empty list.
  29.  */
  30. #if PROTOTYPES
  31. #define PROTO_LIST(list) list
  32. #else
  33. #define PROTO_LIST(list) ()
  34. #endif
  35.  
  36. /* MD5.H - header file for MD5C.C
  37.  */
  38.  
  39. /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
  40. rights reserved.
  41.  
  42. License to copy and use this software is granted provided that it
  43. is identified as the "RSA Data Security, Inc. MD5 Message-Digest
  44. Algorithm" in all material mentioning or referencing this software
  45. or this function.
  46.  
  47. License is also granted to make and use derivative works provided
  48. that such works are identified as "derived from the RSA Data
  49. Security, Inc. MD5 Message-Digest Algorithm" in all material
  50. mentioning or referencing the derived work.
  51.  
  52. RSA Data Security, Inc. makes no representations concerning either
  53. the merchantability of this software or the suitability of this
  54. software for any particular purpose. It is provided "as is"
  55. without express or implied warranty of any kind.
  56.  
  57. These notices must be retained in any copies of any part of this
  58. documentation and/or software.
  59.  */
  60.  
  61. /* MD5 context. */
  62. typedef struct {
  63.   UINT4 state[4];                                   /* state (ABCD) */
  64.   UINT4 count[2];        /* number of bits, modulo 2^64 (lsb first) */
  65.   unsigned char buffer[64];                         /* input buffer */
  66. } MD5_CTX;
  67.  
  68. void MD5Init PROTO_LIST ((MD5_CTX *));
  69. void MD5Update PROTO_LIST
  70.   ((MD5_CTX *, unsigned char *, unsigned int));
  71. void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *));
  72.  
  73.