~ubuntu-branches/ubuntu/trusty/libesmtp/trusty-proposed

« back to all changes in this revision

Viewing changes to crammd5/md5.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy T. Bouse
  • Date: 2002-03-06 08:37:48 UTC
  • Revision ID: james.westby@ubuntu.com-20020306083748-ihmt32mddsslvg5i
Tags: upstream-0.8.11
ImportĀ upstreamĀ versionĀ 0.8.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 
2
/*
 
3
 * This code implements the MD5 message-digest algorithm.
 
4
 * The algorithm is due to Ron Rivest.  This code was
 
5
 * written by Colin Plumb in 1993, no copyright is claimed.
 
6
 * This code is in the public domain; do with it what you wish.
 
7
 *
 
8
 * Equivalent code is available from RSA Data Security, Inc.
 
9
 * This code has been tested against that, and is equivalent,
 
10
 * except that you don't need to include two pages of legalese
 
11
 * with every copy.
 
12
 *
 
13
 * To compute the message digest of a chunk of bytes, declare an
 
14
 * MD5Context structure, pass it to MD5Init, call MD5Update as
 
15
 * needed on buffers full of bytes, and then call MD5Final, which
 
16
 * will fill a supplied 16-byte array with the digest.
 
17
 */
 
18
 
 
19
/* parts of this file are :
 
20
 * Written March 1993 by Branko Lankester
 
21
 * Modified June 1993 by Colin Plumb for altered md5.c.
 
22
 * Modified October 1995 by Erik Troan for RPM
 
23
 */
 
24
#ifndef MD5_UTILS_H
 
25
#define MD5_UTILS_H
 
26
 
 
27
#if SIZEOF_UNSIGNED_INT == 32 / 8
 
28
typedef unsigned int unsigned32_t;
 
29
#elif SIZEOF_UNSIGNED_LONG == 32 / 8
 
30
typedef unsigned long unsigned32_t;
 
31
#else
 
32
#include <sys/types.h>
 
33
typedef uint32 unsigned32_t;
 
34
#endif
 
35
 
 
36
#include <sys/types.h>
 
37
 
 
38
typedef struct {
 
39
        unsigned32_t buf[4];
 
40
        unsigned32_t bits[2];
 
41
        unsigned char in[64];
 
42
        int doByteReverse;
 
43
} MD5Context ;
 
44
 
 
45
/* raw routines */
 
46
void md5_init (MD5Context *ctx);
 
47
void md5_update (MD5Context *ctx, const void *buf, size_t len);
 
48
void md5_final (MD5Context *ctx, unsigned char digest[16]);
 
49
 
 
50
 
 
51
#endif  /* MD5_UTILS_H */