|
Message-ID: <20120809060354.GP27715@brightrain.aerifal.cx> Date: Thu, 9 Aug 2012 02:03:54 -0400 From: Rich Felker <dalias@...ifal.cx> To: musl@...ts.openwall.com Subject: Re: Re: crypt* files in crypt directory On Tue, Aug 07, 2012 at 10:24:21PM -0400, Rich Felker wrote: > Second, what can be done to reduce size? I think the first step is > replacing the giant macros (BF_ROUND, BF_ENCRYPT, etc.) with > functions so that the code doesn't get generated in duplicate unless > aggressive inlining is enabled by CFLAGS. But are there other things > that would help? With the data tables being 4k in size, I'm thinking > a reasonable target size for the whole file might be 7k. > > Actually while writing this, I made some quick changes and seem to > have already achieved that goal. See the attached file. It's untested, > so I might have broken something in the process. I'm not sure I'll > have time to test it well right away, so I'd appreciate comments on > whether it works as well as any other possible improvements... :-) Here's an updated version with a few other minor optimizations - particularly, the base64 encode/decode functions only operate on fixed-size data, so instead of requiring the size as an argument and having loop exit logic after each advance, they only need to check after the advances that could lead into the exit condition. I also made the changes to integrate the code with the caller (crypt_r/crypt) and I'm including the patch for that. Rich View attachment "cbf.diff" of type "text/plain" (1338 bytes) View attachment "crypt_blowfish.c" of type "text/plain" (29280 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.