From 622a9c5c3e7aaf1bb0296ca1d072cc57e8469135 Mon Sep 17 00:00:00 2001 From: Moritz Schulte Date: Fri, 28 Feb 2003 01:41:14 +0000 Subject: 2003-02-23 Moritz Schulte * cipher.c: Remove (bogus) `digitp' macro definition. * md.c: Likewise. * blowfish.c (burn_stack): Removed. * arcfour.c (burn_stack): Likewise. * cast5.c (burn_stack): Likewise. * des.c (burn_stack): Likewise. * md4.c (burn_stack): Likewise. * md5.c (burn_stack): Likewise. * random.c (burn_stack): Likewise. * rijndael.c (burn_stack): Likewise. * rmd160.c (burn_stack): Likewise. * sha1.c (burn_stack): Likewise. * sha256.c (burn_stack): Likewise. * tiger.c (burn_stack): Likewise. * twofish.c (burn_stack): Likewise. * blowfish.c: Changed all occurences of burn_stack to _gcry_burn_stack. * arcfour.c: Likewise. * cast5.c: Likewise. * des.c: Likewise. * md4.c: Likewise. * md5.c: Likewise. * random.c: Likewise. * rijndael.c: Likewise. * rmd160.c: Likewise. * sha1.c: Likewise. * sha256.c: Likewise. * tiger.c: Likewise. * twofish.c: Likewise. * arcfour.c (_gcry_arcfour_get_info): Use GCRY_CIPHER_ARCFOUR instead of hard-coded value `301'. --- cipher/md4.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'cipher/md4.c') diff --git a/cipher/md4.c b/cipher/md4.c index d649f68e..7bb31a8e 100644 --- a/cipher/md4.c +++ b/cipher/md4.c @@ -1,5 +1,5 @@ /* md4.c - MD4 Message-Digest Algorithm - * Copyright (C) 2002 Free Software Foundation, Inc. + * Copyright (C) 2002, 2003 Free Software Foundation, Inc. * * This file is part of Libgcrypt. * @@ -79,17 +79,6 @@ md4_init( MD4_CONTEXT *ctx ) ctx->count = 0; } -static void -burn_stack (int bytes) -{ - char buf[128]; - - memset (buf, 0, sizeof buf); - bytes -= sizeof buf; - if (bytes > 0) - burn_stack (bytes); -} - #define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) #define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) @@ -203,7 +192,7 @@ md4_write( MD4_CONTEXT *hd, byte *inbuf, size_t inlen) { if( hd->count == 64 ) { /* flush the buffer */ transform( hd, hd->buf ); - burn_stack (80+6*sizeof(void*)); + _gcry_burn_stack (80+6*sizeof(void*)); hd->count = 0; hd->nblocks++; } @@ -216,7 +205,7 @@ md4_write( MD4_CONTEXT *hd, byte *inbuf, size_t inlen) if( !inlen ) return; } - burn_stack (80+6*sizeof(void*)); + _gcry_burn_stack (80+6*sizeof(void*)); while( inlen >= 64 ) { transform( hd, inbuf ); @@ -282,7 +271,7 @@ md4_final( MD4_CONTEXT *hd ) hd->buf[62] = msb >> 16; hd->buf[63] = msb >> 24; transform( hd, hd->buf ); - burn_stack (80+6*sizeof(void*)); + _gcry_burn_stack (80+6*sizeof(void*)); p = hd->buf; #ifdef BIG_ENDIAN_HOST -- cgit v1.2.1