Updated to libdes 4.01

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1925 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Björn Groenvall
1997-06-22 10:32:19 +00:00
parent da0f8353ac
commit 78ee74d029
21 changed files with 1172 additions and 491 deletions

View File

@@ -9,12 +9,34 @@ be 100.0.
If possible use gcc v 2.7.?
Turn on the maximum optimising (normally '-O3 -fomit-frame-pointer' for gcc)
In recent times, some system compilers give better performace.
type 'make'
run './destest' to check things are ok.
run './rpw' to check the tty code for reading passwords works.
run './speed' to see how fast those optimisations make the library run :-)
run './des_opts' to determin the best compile time options.
The output from des_opts should be put in the makefile options and des_enc.c
should be rebuilt. For 64 bit computers, do not use the DES_PTR option.
For the DEC Alpha, edit des.h and change DES_LONG to 'unsigned int'
and then you can use the 'DES_PTR' option.
The file options.txt has the options listed for best speed on quite a
few systems. Look and the options (UNROLL, PTR, RISC2 etc) and then
turn on the relevent option in the Makefile
There are some special Makefile targets that make life easier.
make cc - standard cc build
make gcc - standard gcc build
make x86-elf - x86 assember (elf), linux-elf.
make x86-out - x86 assember (a.out), FreeBSD
make x86-solaris- x86 assember
make x86-bsdi - x86 assember (a.out with primative assember).
If at all possible use the assember (for Windows NT/95, use
asm/win32.obj to link with). The x86 assember is very very fast.
A make install will by default install
libdes.a in /usr/local/lib/libdes.a
@@ -36,22 +58,12 @@ decrypted the files on a SparcStation.
I have been able to compile and test the routines with
Microsoft C v 5.1 and Turbo C v 2.0.
The code in this library is in no way optimised for the 16bit
operation of MSDOS. Microsoft C generates code that is 40% slower
than Turbo C's code. I believe this is due to problems it has with
code generation with the 32bit shift operation in the IP and FP
sections. I have added some 16bit optimization in ecb_encrypt.c
and this generated a %70 speedup under Turbo C. Such are the
limitations of DOS compilers :-(.
For Turbo C v 2.0, make sure to define MSDOS, in the relevant menu.
There is an alternative version of the D_ENCRYPT macro that can be
enabled with the -DDES_USE_PTR option in the makefile. This alternative
macro can make a +-%20 speed difference to the DES encryption speed,
depending on the compiler/CPU combinations.
It has its greatest effect on Sparc machines when using the sun compiler.
If in doubt, try enable/disable it and running speed. It does not
seem to affect gcc much.
operation of MSDOS.
When building for glibc, ignore all of the above and just unpack into
glibc-1.??/des and then gmake as per normal.
As a final note on performace. Certain CPUs like sparcs and Alpha often give
a %10 speed difference depending on the link order. It is rather anoying
when one program reports 'x' DES encrypts a second and another reports
'x*0.9' the speed.