~ubuntu-branches/ubuntu/feisty/clamav/feisty

« back to all changes in this revision

Viewing changes to libclamav/md5.c

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-02-20 10:33:44 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20070220103344-zgcu2psnx9d98fpa
Tags: upstream-0.90
ImportĀ upstreamĀ versionĀ 0.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 */
50
50
#if defined(__i386__) || defined(__x86_64__) || defined(__vax__)
51
51
#define SET(n) \
52
 
        (*(const MD5_u32plus *)&ptr[(n) * 4])
 
52
        (*(MD5_u32plus *)&ptr[(n) * 4])
53
53
#define GET(n) \
54
54
        SET(n)
55
55
#else
67
67
 * This processes one or more 64-byte data blocks, but does NOT update
68
68
 * the bit counters.  There are no alignment requirements.
69
69
 */
70
 
static const void *body(cli_md5_ctx *ctx, const void *data, unsigned long size)
 
70
static void *body(cli_md5_ctx *ctx, void *data, unsigned long size)
71
71
{
72
 
        const unsigned char *ptr;
 
72
        unsigned char *ptr;
73
73
        MD5_u32plus a, b, c, d;
74
74
        MD5_u32plus saved_a, saved_b, saved_c, saved_d;
75
75
 
185
185
        ctx->hi = 0;
186
186
}
187
187
 
188
 
void cli_md5_update(cli_md5_ctx *ctx, const void *data, unsigned long size)
 
188
void cli_md5_update(cli_md5_ctx *ctx, void *data, unsigned long size)
189
189
{
190
190
        MD5_u32plus saved_lo;
191
191
        unsigned long used, free;
206
206
                }
207
207
 
208
208
                memcpy(&ctx->buffer[used], data, free);
209
 
                data = (const unsigned char *)data + free;
 
209
                data = (unsigned char *)data + free;
210
210
                size -= free;
211
211
                body(ctx, ctx->buffer, 64);
212
212
        }