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/twofish.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'cipher/twofish.c') diff --git a/cipher/twofish.c b/cipher/twofish.c index 4898b4ba..8fb5f4b4 100644 --- a/cipher/twofish.c +++ b/cipher/twofish.c @@ -1,5 +1,5 @@ /* Twofish for GPG - * Copyright (C) 1998, 2002 Free Software Foundation, Inc. + * Copyright (C) 1998, 2002, 2003 Free Software Foundation, Inc. * Written by Matthew Skala , July 26, 1998 * 256-bit key length added March 20, 1999 * Some modifications to reduce the text size by Werner Koch, April, 1998 @@ -560,17 +560,6 @@ static byte calc_sb_tbl[512] = { ctx->a[(j) + 1] = (y << 9) + (y >> 23) -static void -burn_stack (int bytes) -{ - char buf[64]; - - memset (buf, 0, sizeof buf); - bytes -= sizeof buf; - if (bytes > 0) - burn_stack (bytes); -} - /* Perform the key setup. Note that this works only with 128- and 256-bit * keys, despite the API that looks like it might support other sizes. */ @@ -714,7 +703,7 @@ static int twofish_setkey (TWOFISH_context *ctx, const byte *key, unsigned int keylen) { int rc = do_twofish_setkey (ctx, key, keylen); - burn_stack (23+6*sizeof(void*)); + _gcry_burn_stack (23+6*sizeof(void*)); return rc; } @@ -816,7 +805,7 @@ static void twofish_encrypt (const TWOFISH_context *ctx, byte *out, const byte *in) { do_twofish_encrypt (ctx, out, in); - burn_stack (24+3*sizeof (void*)); + _gcry_burn_stack (24+3*sizeof (void*)); } @@ -858,7 +847,7 @@ static void twofish_decrypt (const TWOFISH_context *ctx, byte *out, const byte *in) { do_twofish_decrypt (ctx, out, in); - burn_stack (24+3*sizeof (void*)); + _gcry_burn_stack (24+3*sizeof (void*)); } -- cgit v1.2.1