1999-09-01 19:59:25 +00:00
|
|
|
# You must select the correct terminal control system to be used to
|
|
|
|
# turn character echo off when reading passwords. There a 5 systems
|
|
|
|
# SGTTY - the old BSD system
|
|
|
|
# TERMIO - most system V boxes
|
|
|
|
# TERMIOS - SGI (ala IRIX).
|
|
|
|
# VMS - the DEC operating system
|
|
|
|
# MSDOS - we all know what it is :-)
|
|
|
|
# read_pwd.c makes a reasonable guess at what is correct.
|
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
# Targets
|
|
|
|
# make - twidle the options yourself :-)
|
|
|
|
# make cc - standard cc options
|
|
|
|
# make gcc - standard gcc options
|
|
|
|
# make x86-elf - linux-elf etc
|
|
|
|
# make x86-out - linux-a.out, FreeBSD etc
|
|
|
|
# make x86-solaris
|
|
|
|
# make x86-bdsi
|
|
|
|
|
1999-09-01 19:59:25 +00:00
|
|
|
# If you are on a DEC Alpha, edit des.h and change the DES_LONG
|
|
|
|
# define to 'unsigned int'. I have seen this give a %20 speedup.
|
|
|
|
|
|
|
|
OPTS0= -DRAND -DTERMIO #-DNOCONST
|
|
|
|
|
|
|
|
# Version 1.94 has changed the strings_to_key function so that it is
|
|
|
|
# now compatible with MITs when the string is longer than 8 characters.
|
|
|
|
# If you wish to keep the old version, uncomment the following line.
|
|
|
|
# This will affect the -E/-D options on des(1).
|
|
|
|
#OPTS1= -DOLD_STR_TO_KEY
|
|
|
|
|
|
|
|
# There are 4 possible performance options
|
|
|
|
# -DDES_PTR
|
|
|
|
# -DDES_RISC1
|
|
|
|
# -DDES_RISC2 (only one of DES_RISC1 and DES_RISC2)
|
|
|
|
# -DDES_UNROLL
|
|
|
|
# after the initial build, run 'des_opts' to see which options are best
|
|
|
|
# for your platform. There are some listed in options.txt
|
|
|
|
#OPTS2= -DDES_PTR
|
|
|
|
#OPTS3= -DDES_RISC1 # or DES_RISC2
|
1999-09-04 12:45:43 +00:00
|
|
|
#OPTS4= -DDES_UNROLL
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
OPTS= $(OPTS0) $(OPTS1) $(OPTS2) $(OPTS3) $(OPTS4)
|
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
MAKE=make -f Makefile
|
|
|
|
#CC=cc
|
|
|
|
#CFLAG= -O
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
CC=gcc
|
|
|
|
#CFLAG= -O4 -funroll-loops -fomit-frame-pointer
|
|
|
|
CFLAG= -O3 -fomit-frame-pointer
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
CFLAGS=$(OPTS) $(CFLAG)
|
1999-09-01 19:59:25 +00:00
|
|
|
CPP=$(CC) -E
|
1999-09-04 12:45:43 +00:00
|
|
|
AS=as
|
|
|
|
RANLIB=ranlib
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
# Assember version of des_encrypt*().
|
|
|
|
DES_ENC=des_enc.o fcrypt_b.o # normal C version
|
|
|
|
#DES_ENC=asm/dx86-elf.o asm/yx86-elf.o # elf format x86
|
|
|
|
#DES_ENC=asm/dx86-out.o asm/yx86-out.o # a.out format x86
|
|
|
|
#DES_ENC=asm/dx86-sol.o asm/yx86-sol.o # solaris format x86
|
|
|
|
#DES_ENC=asm/dx86bsdi.o asm/yx86basi.o # bsdi format x86
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
LIBDIR=/usr/local/lib
|
|
|
|
BINDIR=/usr/local/bin
|
|
|
|
INCDIR=/usr/local/include
|
|
|
|
MANDIR=/usr/local/man
|
|
|
|
MAN1=1
|
|
|
|
MAN3=3
|
|
|
|
SHELL=/bin/sh
|
1999-09-04 12:45:43 +00:00
|
|
|
OBJ_LIT=cbc_enc.o ecb_enc.o $(DES_ENC) fcrypt.o set_key.o
|
|
|
|
OBJ_FULL=cbc_cksm.o $(OBJ_LIT) pcbc_enc.o \
|
|
|
|
xcbc_enc.o qud_cksm.o cbc3_enc.o \
|
|
|
|
cfb64ede.o cfb64enc.o cfb_enc.o ecb3_enc.o \
|
|
|
|
enc_read.o enc_writ.o ofb64ede.o ofb64enc.o ofb_enc.o \
|
|
|
|
rand_key.o read_pwd.o read2pwd.o rpc_enc.o str2key.o supp.o
|
|
|
|
|
|
|
|
GENERAL_LIT=COPYRIGHT INSTALL README VERSION Makefile des_crypt.man \
|
|
|
|
des.doc options.txt asm
|
|
|
|
GENERAL_FULL=$(GENERAL_LIT) FILES Imakefile times vms.com KERBEROS MODES.DES \
|
|
|
|
des.man DES.pm DES.pod DES.xs Makefile.PL dess.cpp des3s.cpp \
|
1999-09-01 19:59:25 +00:00
|
|
|
Makefile.uni typemap t Makefile.ssl makefile.bc Makefile.lit \
|
|
|
|
des.org des_locl.org
|
1999-09-04 12:45:43 +00:00
|
|
|
TESTING_LIT= destest speed des_opts
|
|
|
|
TESTING_FULL= rpw des $(TESTING_LIT)
|
|
|
|
TESTING_SRC_LIT=destest.c speed.c des_opts.c
|
|
|
|
TESTING_SRC_FULL=rpw.c des.c $(TESTING_SRC_LIT)
|
|
|
|
HEADERS_LIT=des_ver.h des.h des_locl.h podd.h sk.h spr.h
|
|
|
|
HEADERS_FULL= $(HEADERS_LIT) rpc_des.h
|
|
|
|
LIBDES_LIT=cbc_enc.c ecb_enc.c fcrypt.c set_key.c des_enc.c fcrypt_b.c
|
|
|
|
LIBDES_FULL= cbc_cksm.c pcbc_enc.c qud_cksm.c cbc3_enc.c \
|
|
|
|
cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c \
|
1999-09-01 19:59:25 +00:00
|
|
|
enc_read.c enc_writ.c ofb64ede.c ofb64enc.c ofb_enc.c \
|
|
|
|
rand_key.c rpc_enc.c str2key.c supp.c \
|
1999-09-04 12:45:43 +00:00
|
|
|
xcbc_enc.c $(LIBDES_LIT) read_pwd.c read2pwd.c
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
PERL= des.pl testdes.pl doIP doPC1 doPC2 PC1 PC2 shifts.pl
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
OBJ= $(OBJ_FULL)
|
|
|
|
GENERAL=$(GENERAL_FULL)
|
|
|
|
TESTING=$(TESTING_FULL)
|
|
|
|
TESTING_SRC=$(TESTING_SRC_FULL)
|
|
|
|
HEADERS=$(HEADERS_FULL)
|
|
|
|
LIBDES= $(LIBDES_FULL)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
ALL= $(GENERAL) $(TESTING_SRC) $(LIBDES) $(PERL) $(HEADERS)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
DLIB= libdes.a
|
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
all: $(DLIB) $(TESTING)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
cc:
|
1999-09-04 12:45:43 +00:00
|
|
|
$(MAKE) CC=cc CFLAGS="-O $(OPTS) $(CFLAG)" all
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
gcc:
|
1999-09-04 12:45:43 +00:00
|
|
|
$(MAKE) CC=gcc CFLAGS="-O3 -fomit-frame-pointer $(OPTS) $(CFLAG)" all
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
x86-elf:
|
1999-09-04 12:45:43 +00:00
|
|
|
$(MAKE) DES_ENC='asm/dx86-elf.o asm/yx86-elf.o' CC=$(CC) CFLAGS="-DELF $(OPTS) $(CFLAG)" all
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
x86-out:
|
1999-09-04 12:45:43 +00:00
|
|
|
$(MAKE) DES_ENC='asm/dx86-out.o asm/yx86-out.o' CC=$(CC) CFLAGS="-DOUT $(OPTS) $(CFLAG)" all
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
x86-solaris:
|
1999-09-04 12:45:43 +00:00
|
|
|
$(MAKE) DES_ENC='asm/dx86-sol.o asm/yx86-sol.o' CC=$(CC) CFLAGS="-DSOL $(OPTS) $(CFLAG)" all
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
x86-bsdi:
|
1999-09-04 12:45:43 +00:00
|
|
|
$(MAKE) DES_ENC='asm/dx86bsdi.o asm/yx86bsdi.o' CC=$(CC) CFLAGS="-DBSDI $(OPTS) $(CFLAG)" all
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
# elf
|
|
|
|
asm/dx86-elf.o: asm/dx86unix.cpp
|
|
|
|
$(CPP) -DELF asm/dx86unix.cpp | $(AS) -o asm/dx86-elf.o
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
asm/yx86-elf.o: asm/yx86unix.cpp
|
|
|
|
$(CPP) -DELF asm/yx86unix.cpp | $(AS) -o asm/yx86-elf.o
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
# solaris
|
|
|
|
asm/dx86-sol.o: asm/dx86unix.cpp
|
|
|
|
$(CC) -E -DSOL asm/dx86unix.cpp | sed 's/^#.*//' > asm/dx86-sol.s
|
|
|
|
as -o asm/dx86-sol.o asm/dx86-sol.s
|
|
|
|
rm -f asm/dx86-sol.s
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
asm/yx86-sol.o: asm/yx86unix.cpp
|
|
|
|
$(CC) -E -DSOL asm/yx86unix.cpp | sed 's/^#.*//' > asm/yx86-sol.s
|
|
|
|
as -o asm/yx86-sol.o asm/yx86-sol.s
|
|
|
|
rm -f asm/yx86-sol.s
|
|
|
|
|
|
|
|
# a.out
|
|
|
|
asm/dx86-out.o: asm/dx86unix.cpp
|
|
|
|
$(CPP) -DOUT asm/dx86unix.cpp | $(AS) -o asm/dx86-out.o
|
|
|
|
|
|
|
|
asm/yx86-out.o: asm/yx86unix.cpp
|
|
|
|
$(CPP) -DOUT asm/yx86unix.cpp | $(AS) -o asm/yx86-out.o
|
|
|
|
|
|
|
|
# bsdi
|
|
|
|
asm/dx86bsdi.o: asm/dx86unix.cpp
|
|
|
|
$(CPP) -DBSDI asm/dx86unix.cpp | $(AS) -o asm/dx86bsdi.o
|
|
|
|
|
|
|
|
asm/yx86bsdi.o: asm/yx86unix.cpp
|
|
|
|
$(CPP) -DBSDI asm/yx86unix.cpp | $(AS) -o asm/yx86bsdi.o
|
|
|
|
|
|
|
|
asm/dx86unix.cpp:
|
|
|
|
(cd asm; perl des-586.pl cpp >dx86unix.cpp)
|
|
|
|
|
|
|
|
asm/yx86unix.cpp:
|
|
|
|
(cd asm; perl crypt586.pl cpp >yx86unix.cpp)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
test: all
|
|
|
|
./destest
|
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
$(DLIB): $(OBJ)
|
1999-09-01 19:59:25 +00:00
|
|
|
/bin/rm -f $(DLIB)
|
1999-09-04 12:45:43 +00:00
|
|
|
ar cr $(DLIB) $(OBJ)
|
|
|
|
$(RANLIB) $(DLIB)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
des_opts: des_opts.o $(DLIB)
|
|
|
|
$(CC) $(CFLAGS) -o des_opts des_opts.o $(DLIB)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
destest: destest.o $(DLIB)
|
|
|
|
$(CC) $(CFLAGS) -o destest destest.o $(DLIB)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
rpw: rpw.o $(DLIB)
|
|
|
|
$(CC) $(CFLAGS) -o rpw rpw.o $(DLIB)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
speed: speed.o $(DLIB)
|
|
|
|
$(CC) $(CFLAGS) -o speed speed.o $(DLIB)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
1999-09-04 12:45:43 +00:00
|
|
|
des: des.o $(DLIB)
|
|
|
|
$(CC) $(CFLAGS) -o des des.o $(DLIB)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
tags:
|
1999-09-04 12:45:43 +00:00
|
|
|
ctags $(TESTING_SRC) $(LIBDES)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
tar_lit:
|
|
|
|
/bin/mv Makefile Makefile.tmp
|
|
|
|
/bin/cp Makefile.lit Makefile
|
1999-09-04 12:45:43 +00:00
|
|
|
for i in $(HEADERS_LIT) $(LIBDES_LIT) $(GENERAL_LIT) $(TESTING_SRC_LIT) ;\
|
|
|
|
do \
|
|
|
|
n="$$n des/$$i"; \
|
|
|
|
done; \
|
|
|
|
( cd .. ; tar chf - $$n )| gzip > libdes-l.tgz
|
1999-09-01 19:59:25 +00:00
|
|
|
/bin/rm -f Makefile
|
|
|
|
/bin/mv Makefile.tmp Makefile
|
|
|
|
|
|
|
|
tar:
|
1999-09-04 12:45:43 +00:00
|
|
|
mv Makefile Makefile.tmp
|
|
|
|
/bin/cp Makefile.uni Makefile
|
|
|
|
for i in $(ALL) ;\
|
|
|
|
do \
|
|
|
|
n="$$n des/$$i"; \
|
|
|
|
done; \
|
|
|
|
( cd .. ; tar chf - $$n )| gzip > libdes.tgz
|
|
|
|
/bin/rm -f Makefile
|
|
|
|
/bin/mv Makefile.tmp Makefile
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
shar:
|
|
|
|
shar $(ALL) >libdes.shar
|
|
|
|
|
|
|
|
depend:
|
1999-09-04 12:45:43 +00:00
|
|
|
makedepend $(LIBDES) $(TESTING_SRC)
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
clean:
|
1999-09-04 12:45:43 +00:00
|
|
|
/bin/rm -f *.o tags core $(TESTING) $(DLIB) .nfs* *.old *.bak asm/*.o
|
1999-09-01 19:59:25 +00:00
|
|
|
|
|
|
|
dclean:
|
|
|
|
sed -e '/^# DO NOT DELETE THIS LINE/ q' Makefile >Makefile.new
|
|
|
|
mv -f Makefile.new Makefile
|
|
|
|
|
|
|
|
# Eric is probably going to choke when he next looks at this --tjh
|
1999-09-04 12:45:43 +00:00
|
|
|
install: des
|
1999-09-01 19:59:25 +00:00
|
|
|
if test $(INSTALLTOP); then \
|
|
|
|
echo SSL style install; \
|
|
|
|
cp $(DLIB) $(INSTALLTOP)/lib; \
|
1999-09-04 12:45:43 +00:00
|
|
|
$(RANLIB) $(DLIB); \
|
1999-09-01 19:59:25 +00:00
|
|
|
chmod 644 $(INSTALLTOP)/lib/$(DLIB); \
|
|
|
|
cp des.h $(INSTALLTOP)/include; \
|
|
|
|
chmod 644 $(INSTALLTOP)/include/des.h; \
|
|
|
|
else \
|
|
|
|
echo Standalone install; \
|
|
|
|
cp $(DLIB) $(LIBDIR)/$(DLIB); \
|
1999-09-04 12:45:43 +00:00
|
|
|
$(RANLIB) $(DLIB); \
|
1999-09-01 19:59:25 +00:00
|
|
|
chmod 644 $(LIBDIR)/$(DLIB); \
|
|
|
|
cp des $(BINDIR)/des; \
|
|
|
|
chmod 711 $(BINDIR)/des; \
|
|
|
|
cp des_crypt.man $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
|
|
|
|
chmod 644 $(MANDIR)/man$(MAN3)/des_crypt.$(MAN3); \
|
|
|
|
cp des.man $(MANDIR)/man$(MAN1)/des.$(MAN1); \
|
|
|
|
chmod 644 $(MANDIR)/man$(MAN1)/des.$(MAN1); \
|
|
|
|
cp des.h $(INCDIR)/des.h; \
|
|
|
|
chmod 644 $(INCDIR)/des.h; \
|
|
|
|
fi
|
|
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|