Alexandre Savard | 1b09e31 | 2012-08-07 20:33:29 -0400 | [diff] [blame] | 1 | Check the CC and CFLAGS lines in the makefile |
| 2 | |
| 3 | If your C library does not support the times(3) function, change the |
| 4 | #define TIMES to |
| 5 | #undef TIMES in speed.c |
| 6 | If it does, check the HZ value for the times(3) function. |
| 7 | If your system does not define CLK_TCK it will be assumed to |
| 8 | be 100.0. |
| 9 | |
| 10 | If possible use gcc v 2.7.? |
| 11 | Turn on the maximum optimising (normally '-O3 -fomit-frame-pointer' for gcc) |
| 12 | In recent times, some system compilers give better performace. |
| 13 | |
| 14 | type 'make' |
| 15 | |
| 16 | run './destest' to check things are ok. |
| 17 | run './rpw' to check the tty code for reading passwords works. |
| 18 | run './speed' to see how fast those optimisations make the library run :-) |
| 19 | run './des_opts' to determin the best compile time options. |
| 20 | |
| 21 | The output from des_opts should be put in the makefile options and des_enc.c |
| 22 | should be rebuilt. For 64 bit computers, do not use the DES_PTR option. |
| 23 | For the DEC Alpha, edit des.h and change DES_LONG to 'unsigned int' |
| 24 | and then you can use the 'DES_PTR' option. |
| 25 | |
| 26 | The file options.txt has the options listed for best speed on quite a |
| 27 | few systems. Look and the options (UNROLL, PTR, RISC2 etc) and then |
| 28 | turn on the relevant option in the Makefile. |
| 29 | |
| 30 | There are some special Makefile targets that make life easier. |
| 31 | make cc - standard cc build |
| 32 | make gcc - standard gcc build |
| 33 | make x86-elf - x86 assembler (elf), linux-elf. |
| 34 | make x86-out - x86 assembler (a.out), FreeBSD |
| 35 | make x86-solaris- x86 assembler |
| 36 | make x86-bsdi - x86 assembler (a.out with primative assembler). |
| 37 | |
| 38 | If at all possible use the assembler (for Windows NT/95, use |
| 39 | asm/win32.obj to link with). The x86 assembler is very very fast. |
| 40 | |
| 41 | A make install will by default install |
| 42 | libdes.a in /usr/local/lib/libdes.a |
| 43 | des in /usr/local/bin/des |
| 44 | des_crypt.man in /usr/local/man/man3/des_crypt.3 |
| 45 | des.man in /usr/local/man/man1/des.1 |
| 46 | des.h in /usr/include/des.h |
| 47 | |
| 48 | des(1) should be compatible with sunOS's but I have been unable to |
| 49 | test it. |
| 50 | |
| 51 | These routines should compile on MSDOS, most 32bit and 64bit version |
| 52 | of Unix (BSD and SYSV) and VMS, without modification. |
| 53 | The only problems should be #include files that are in the wrong places. |
| 54 | |
| 55 | These routines can be compiled under MSDOS. |
| 56 | I have successfully encrypted files using des(1) under MSDOS and then |
| 57 | decrypted the files on a SparcStation. |
| 58 | I have been able to compile and test the routines with |
| 59 | Microsoft C v 5.1 and Turbo C v 2.0. |
| 60 | The code in this library is in no way optimised for the 16bit |
| 61 | operation of MSDOS. |
| 62 | |
| 63 | When building for glibc, ignore all of the above and just unpack into |
| 64 | glibc-1.??/des and then gmake as per normal. |
| 65 | |
| 66 | As a final note on performace. Certain CPUs like sparcs and Alpha often give |
| 67 | a %10 speed difference depending on the link order. It is rather anoying |
| 68 | when one program reports 'x' DES encrypts a second and another reports |
| 69 | 'x*0.9' the speed. |