md5.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* ppp_md5.c - PPP MD5 security header */
  2. /* Copyright 1995 Wind River Systems, Inc. */
  3. /*
  4.  ***********************************************************************
  5.  ** md5.h -- header file for implementation of MD5                    **
  6.  ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
  7.  ** Created: 2/17/90 RLR                                              **
  8.  ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version               **
  9.  ** Revised (for MD5): RLR 4/27/91                                    **
  10.  **   -- G modified to have y&~z instead of y&z                       **
  11.  **   -- FF, GG, HH modified to add in last register done             **
  12.  **   -- Access pattern: round 2 works mod 5, round 3 works mod 3     **
  13.  **   -- distinct additive constant for each step                     **
  14.  **   -- round 4 added, working mod 7                                 **
  15.  ***********************************************************************
  16.  */
  17. /*
  18.  ***********************************************************************
  19.  ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved.  **
  20.  **                                                                   **
  21.  ** License to copy and use this software is granted provided that    **
  22.  ** it is identified as the "RSA Data Security, Inc. MD5 Message-     **
  23.  ** Digest Algorithm" in all material mentioning or referencing this  **
  24.  ** software or this function.                                        **
  25.  **                                                                   **
  26.  ** License is also granted to make and use derivative works          **
  27.  ** provided that such works are identified as "derived from the RSA  **
  28.  ** Data Security, Inc. MD5 Message-Digest Algorithm" in all          **
  29.  ** material mentioning or referencing the derived work.              **
  30.  **                                                                   **
  31.  ** RSA Data Security, Inc. makes no representations concerning       **
  32.  ** either the merchantability of this software or the suitability    **
  33.  ** of this software for any particular purpose.  It is provided "as  **
  34.  ** is" without express or implied warranty of any kind.              **
  35.  **                                                                   **
  36.  ** These notices must be retained in any copies of any part of this  **
  37.  ** documentation and/or software.                                    **
  38.  ***********************************************************************
  39.  */
  40. /*
  41. modification history
  42. --------------------
  43. 01a,16jan95,dzb  WRS-ize.
  44. */
  45. #ifndef __INCmd5h
  46. #define __INCmd5h
  47. #ifdef  __cplusplus
  48. extern "C" {
  49. #endif
  50. /* typedef a 32-bit type */
  51. typedef unsigned long int UINT4;
  52. /* Data structure for MD5 (Message-Digest) computation */
  53. typedef struct {
  54.   UINT4 i[2];                   /* number of _bits_ handled mod 2^64 */
  55.   UINT4 buf[4];                                    /* scratch buffer */
  56.   unsigned char in[64];                              /* input buffer */
  57.   unsigned char digest[16];     /* actual digest after MD5Final call */
  58. } MD5_CTX;
  59. /* function declarations */
  60. #if defined(__STDC__) || defined(__cplusplus)
  61. extern void ppp_MD5Init (MD5_CTX *mdContext);
  62. extern void ppp_MD5Update (MD5_CTX *mdContext, unsigned char *inBuf,
  63.     unsigned int inLen);
  64. extern void ppp_MD5Final (MD5_CTX *mdContext);
  65. #else   /* __STDC__ */
  66. extern void ppp_MD5Init ();
  67. extern void ppp_MD5Update ();
  68. extern void ppp_MD5Final ();
  69. #endif  /* __STDC__ */
  70. #ifdef  __cplusplus
  71. }
  72. #endif
  73. #endif /* __INCmd5h */