1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License as
4 * published by the Free Software Foundation; either version 2 of
5 * the License, or (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
15 * MA 02111-1307 USA
16 */
17/*
18 * md5.h, copied from src/router/ppp/pppd to src/include/bcmcrypto for general use
19 *
20 *
21 ***********************************************************************
22 ** md5.h -- header file for implementation of MD5                    **
23 ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
24 ** Created: 2/17/90 RLR                                              **
25 ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version               **
26 ** Revised (for MD5): RLR 4/27/91                                    **
27 **   -- G modified to have y&~z instead of y&z                       **
28 **   -- FF, GG, HH modified to add in last register done             **
29 **   -- Access pattern: round 2 works mod 5, round 3 works mod 3     **
30 **   -- distinct additive constant for each step                     **
31 **   -- round 4 added, working mod 7                                 **
32 ***********************************************************************
33 */
34
35/*
36 ***********************************************************************
37 ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved.  **
38 **                                                                   **
39 ** License to copy and use this software is granted provided that    **
40 ** it is identified as the "RSA Data Security, Inc. MD5 Message-     **
41 ** Digest Algorithm" in all material mentioning or referencing this  **
42 ** software or this function.                                        **
43 **                                                                   **
44 ** License is also granted to make and use derivative works          **
45 ** provided that such works are identified as "derived from the RSA  **
46 ** Data Security, Inc. MD5 Message-Digest Algorithm" in all          **
47 ** material mentioning or referencing the derived work.              **
48 **                                                                   **
49 ** RSA Data Security, Inc. makes no representations concerning       **
50 ** either the merchantability of this software or the suitability    **
51 ** of this software for any particular purpose.  It is provided "as  **
52 ** is" without express or implied warranty of any kind.              **
53 **                                                                   **
54 ** These notices must be retained in any copies of any part of this  **
55 ** documentation and/or software.                                    **
56 ***********************************************************************
57 */
58
59#ifndef __MD5_INCLUDE__
60
61#include <typedefs.h>
62
63/* Data structure for MD5 (Message-Digest) computation */
64typedef struct {
65  uint32 i[2];                   /* number of _bits_ handled mod 2^64 */
66  uint32 buf[4];                                    /* scratch buffer */
67  unsigned char in[64];                              /* input buffer */
68  unsigned char digest[16];     /* actual digest after MD5Final call */
69} MD5_CTX;
70
71void MD5Init (MD5_CTX *mdContext);
72void MD5Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen);
73void MD5Final (unsigned char *hash, MD5_CTX *mdContext);
74
75#define __MD5_INCLUDE__
76#endif /* __MD5_INCLUDE__ */
77