summaryrefslogtreecommitdiff
path: root/libcrypt
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-07-18 22:30:43 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-07-18 22:30:43 +0000
commit373fe15a8a4c5b974717742e5c61091e02130c3c (patch)
tree3ca317ce069aa1c267fb6ab8b68c10635ebbf9e5 /libcrypt
parentbc1f2a2fe6c929658d588c4c8a317611b2dc4506 (diff)
des.c: move 0.5k of static data on stack, they are used only temporarily
by des_init.
Diffstat (limited to 'libcrypt')
-rw-r--r--libcrypt/des.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libcrypt/des.c b/libcrypt/des.c
index db2e22cb9..f715541b7 100644
--- a/libcrypt/des.c
+++ b/libcrypt/des.c
@@ -70,7 +70,6 @@
* struct crypt_data to make this really reentrant... */
static u_char inv_key_perm[64];
static u_char inv_comp_perm[56];
-static u_char u_sbox[8][64];
static u_char un_pbox[32];
static u_int32_t en_keysl[16], en_keysr[16];
static u_int32_t de_keysl[16], de_keysr[16];
@@ -194,7 +193,6 @@ static const u_int32_t bits32[32] =
};
static const u_char bits8[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
-static const u_int32_t *bits28, *bits24;
static int
@@ -218,12 +216,15 @@ ascii_to_bin(char ch)
static void
des_init(void)
{
+ static int des_initialised = 0;
+
int i, j, b, k, inbit, obit;
u_int32_t *p, *il, *ir, *fl, *fr;
- static int des_initialised = 0;
+ const u_int32_t *bits28, *bits24;
+ u_char u_sbox[8][64];
if (des_initialised==1)
- return;
+ return;
old_rawkey0 = old_rawkey1 = 0L;
saltbits = 0L;