1/*
2 * md5.h, copied from src/router/ppp/pppd to src/include/bcmcrypto for general use
3 *
4 * $Id: md5.h,v 1.1.1.1 2008/10/15 03:31:22 james26_jang Exp $
5 *
6 ***********************************************************************
7 ** md5.h -- header file for implementation of MD5                    **
8 ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
9 ** Created: 2/17/90 RLR                                              **
10 ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version               **
11 ** Revised (for MD5): RLR 4/27/91                                    **
12 **   -- G modified to have y&~z instead of y&z                       **
13 **   -- FF, GG, HH modified to add in last register done             **
14 **   -- Access pattern: round 2 works mod 5, round 3 works mod 3     **
15 **   -- distinct additive constant for each step                     **
16 **   -- round 4 added, working mod 7                                 **
17 ***********************************************************************
18 */
19
20/*
21 ***********************************************************************
22 ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved.  **
23 **                                                                   **
24 ** License to copy and use this software is granted provided that    **
25 ** it is identified as the "RSA Data Security, Inc. MD5 Message-     **
26 ** Digest Algorithm" in all material mentioning or referencing this  **
27 ** software or this function.                                        **
28 **                                                                   **
29 ** License is also granted to make and use derivative works          **
30 ** provided that such works are identified as "derived from the RSA  **
31 ** Data Security, Inc. MD5 Message-Digest Algorithm" in all          **
32 ** material mentioning or referencing the derived work.              **
33 **                                                                   **
34 ** RSA Data Security, Inc. makes no representations concerning       **
35 ** either the merchantability of this software or the suitability    **
36 ** of this software for any particular purpose.  It is provided "as  **
37 ** is" without express or implied warranty of any kind.              **
38 **                                                                   **
39 ** These notices must be retained in any copies of any part of this  **
40 ** documentation and/or software.                                    **
41 ***********************************************************************
42 */
43
44#ifndef __MD5_INCLUDE__
45
46#include <typedefs.h>
47
48/* Data structure for MD5 (Message-Digest) computation */
49typedef struct {
50  uint32 i[2];                   /* number of _bits_ handled mod 2^64 */
51  uint32 buf[4];                                    /* scratch buffer */
52  unsigned char in[64];                              /* input buffer */
53  unsigned char digest[16];     /* actual digest after MD5Final call */
54} MD5_CTX;
55
56void MD5Init (MD5_CTX *mdContext);
57void MD5Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen);
58void MD5Final (unsigned char *hash, MD5_CTX *mdContext);
59
60#define __MD5_INCLUDE__
61#endif /* __MD5_INCLUDE__ */
62