Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site rochester.UUCP Path: utzoo!linus!decvax!harpo!seismo!rochester!mayer From: mayer@rochester.UUCP (Jim Mayer) Newsgroups: btl.unix,net.unix-wizards Subject: Re: Use of encrypt (3C) Message-ID: <4366@rochester.UUCP> Date: Tue, 10-Jan-84 14:38:44 EST Article-I.D.: rocheste.4366 Posted: Tue Jan 10 14:38:44 1984 Date-Received: Wed, 11-Jan-84 08:36:48 EST References: <482@ihuxn.UUCP> Organization: U. of Rochester, CS Dept. Lines: 45 There is a bug in the encrypt/setkey stuff under 4.1c. The problem is that the "E table" is initialized only in the crypt routine. If encrypt/setkey are used independently of crypt the "E table" is left undefined. You can use the routines if you call "crypt" first, but the encryption will be done with a non standard table. To fix the problem, move the initialization "for" loop into "setkey". You will also have to move the declaration of the "e" and "E" arrays up above the "setkey" definition (otherwise they are undefined). The following stuff is a "diff" between the old and new versions. -- Jim Mayer (rochester!mayer) 23a24,38 > * The E bit-selection table. > */ > static char E[48]; > static char e[] = { > 32, 1, 2, 3, 4, 5, ... > 28,29,30,31,32, 1, > }; > > /* 104a120,125 > * Remember to initialize the E table first! > */ > for(i=0;i<48;i++) > E[i] = e[i]; > > /* 144,158d164 < * The E bit-selection table. < */ < static char E[48]; < static char e[] = { < 32, 1, 2, 3, 4, 5, ... < 28,29,30,31,32, 1, < }; < < /* 344,346d349 < < for(i=0;i<48;i++) < E[i] = e[i];