~ubuntu-branches/ubuntu/utopic/critcl/utopic

« back to all changes in this revision

Viewing changes to lib/md5c/md5c_c/md5.h

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura
  • Date: 2013-05-11 00:08:06 UTC
  • Revision ID: package-import@ubuntu.com-20130511000806-7hq1zc3fnn0gat79
Tags: upstream-3.1.9
ImportĀ upstreamĀ versionĀ 3.1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef MD5_H
 
2
#define MD5_H
 
3
 
 
4
/*
 
5
 ***********************************************************************
 
6
 ** md5.h -- header file for implementation of MD5                    **
 
7
 ** RSA Data Security, Inc. MD5 Message-Digest Algorithm              **
 
8
 ** Created: 2/17/90 RLR                                              **
 
9
 ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version               **
 
10
 ** Revised (for MD5): RLR 4/27/91                                    **
 
11
 **   -- G modified to have y&~z instead of y&z                       **
 
12
 **   -- FF, GG, HH modified to add in last register done             **
 
13
 **   -- Access pattern: round 2 works mod 5, round 3 works mod 3     **
 
14
 **   -- distinct additive constant for each step                     **
 
15
 **   -- round 4 added, working mod 7                                 **
 
16
 ***********************************************************************
 
17
 */
 
18
 
 
19
/*
 
20
 * Edited 7 May 93 by CP to change the interface to match that
 
21
 * of the MD5 routines in RSAREF.  Due to this alteration, this
 
22
 * code is "derived from the RSA Data Security, Inc. MD5 Message-
 
23
 * Digest Algorithm".  (See below.)  Also added argument names
 
24
 * to the prototypes.
 
25
 */
 
26
 
 
27
/*
 
28
 ***********************************************************************
 
29
 ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved.  **
 
30
 **                                                                   **
 
31
 ** License to copy and use this software is granted provided that    **
 
32
 ** it is identified as the "RSA Data Security, Inc. MD5 Message-     **
 
33
 ** Digest Algorithm" in all material mentioning or referencing this  **
 
34
 ** software or this function.                                        **
 
35
 **                                                                   **
 
36
 ** License is also granted to make and use derivative works          **
 
37
 ** provided that such works are identified as "derived from the RSA  **
 
38
 ** Data Security, Inc. MD5 Message-Digest Algorithm" in all          **
 
39
 ** material mentioning or referencing the derived work.              **
 
40
 **                                                                   **
 
41
 ** RSA Data Security, Inc. makes no representations concerning       **
 
42
 ** either the merchantability of this software or the suitability    **
 
43
 ** of this software for any particular purpose.  It is provided "as  **
 
44
 ** is" without express or implied warranty of any kind.              **
 
45
 **                                                                   **
 
46
 ** These notices must be retained in any copies of any part of this  **
 
47
 ** documentation and/or software.                                    **
 
48
 ***********************************************************************
 
49
 */
 
50
 
 
51
/* typedef a 32-bit type */
 
52
#ifdef __alpha
 
53
typedef unsigned int UINT4;
 
54
#else
 
55
typedef unsigned long int UINT4;
 
56
#endif
 
57
 
 
58
/* Data structure for MD5 (Message-Digest) computation */
 
59
typedef struct {
 
60
  UINT4 buf[4];                                    /* scratch buffer */
 
61
  UINT4 i[2];                   /* number of _bits_ handled mod 2^64 */
 
62
  unsigned char in[64];                              /* input buffer */
 
63
} MD5_CTX;
 
64
 
 
65
void MD5Init   (MD5_CTX *mdContext);
 
66
void MD5Update (MD5_CTX *mdContext, unsigned char *buf, unsigned int len);
 
67
void MD5Final  (unsigned char digest[16], MD5_CTX *mdContext);
 
68
void Transform (UINT4 *buf, UINT4 *in);
 
69
 
 
70
#endif