summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>1997-07-06 08:51:39 +0000
committerNiels Provos <provos@cvs.openbsd.org>1997-07-06 08:51:39 +0000
commitab22a7803e383a35a3514bc14c2fea8487192047 (patch)
tree2aec87a277b8961615c2b71c431484e6df7720a1
parent8fcf9bcb34d01ac7ec8ff8945267008f88fe1142 (diff)
obsolete.
-rw-r--r--kerberosIV/des/COPYRIGHT50
-rw-r--r--kerberosIV/des/Makefile22
-rw-r--r--kerberosIV/des/README47
-rw-r--r--kerberosIV/des/VERSION312
-rw-r--r--kerberosIV/des/cbc3_enc.c88
-rw-r--r--kerberosIV/des/cbc_cksm.c92
-rw-r--r--kerberosIV/des/cbc_enc.c114
-rw-r--r--kerberosIV/des/cfb64ede.c152
-rw-r--r--kerberosIV/des/cfb64enc.c116
-rw-r--r--kerberosIV/des/cfb_enc.c160
-rw-r--r--kerberosIV/des/des_crypt.3509
-rw-r--r--kerberosIV/des/des_locl.h273
-rw-r--r--kerberosIV/des/ecb3_enc.c77
-rw-r--r--kerberosIV/des/ecb_enc.c203
-rw-r--r--kerberosIV/des/ede_enc.c163
-rw-r--r--kerberosIV/des/enc_read.c189
-rw-r--r--kerberosIV/des/enc_writ.c142
-rw-r--r--kerberosIV/des/fcrypt.c654
-rw-r--r--kerberosIV/des/ncbc_enc.c120
-rw-r--r--kerberosIV/des/ofb64ede.c126
-rw-r--r--kerberosIV/des/ofb64enc.c103
21 files changed, 0 insertions, 3712 deletions
diff --git a/kerberosIV/des/COPYRIGHT b/kerberosIV/des/COPYRIGHT
deleted file mode 100644
index dc789d4fdce..00000000000
--- a/kerberosIV/des/COPYRIGHT
+++ /dev/null
@@ -1,50 +0,0 @@
-Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
-All rights reserved.
-
-This package is an DES implementation written by Eric Young (eay@mincom.oz.au).
-The implementation was written so as to conform with MIT's libdes.
-
-This library is free for commercial and non-commercial use as long as
-the following conditions are aheared to. The following conditions
-apply to all code found in this distribution.
-
-Copyright remains Eric Young's, and as such any Copyright notices in
-the code are not to be removed.
-If this package is used in a product, Eric Young should be given attribution
-as the author of that the SSL library. This can be in the form of a textual
-message at program startup or in documentation (online or textual) provided
-with the package.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
- must display the following acknowledgement:
- This product includes software developed by Eric Young (eay@mincom.oz.au)
-
-THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-The license and distribution terms for any publically available version or
-derivative of this code cannot be changed. i.e. this code cannot simply be
-copied and put under another distrubution license
-[including the GNU Public License.]
-
-The reason behind this being stated in this direct manner is past
-experience in code simply being copied and the attribution removed
-from it and then being distributed as part of other packages. This
-implementation was a non-trivial and unpaid effort.
diff --git a/kerberosIV/des/Makefile b/kerberosIV/des/Makefile
deleted file mode 100644
index 566941137dc..00000000000
--- a/kerberosIV/des/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-# $Id: Makefile,v 1.2 1996/02/10 21:04:17 tholo Exp $
-
-LIB= des
-SRCS= cbc_cksm.c cbc_enc.c cbc3_enc.c cfb_enc.c cfb64ede.c cfb64enc.c \
- ecb_enc.c ecb3_enc.c ede_enc.c enc_read.c enc_writ.c fcrypt.c \
- ncbc_enc.c ofb_enc.c ofb64ede.c ofb64enc.c pcbc_enc.c qud_cksm.c \
- rand_key.c read_pwd.c rnd_keys.c rpc_enc.c set_key.c str2key.c supp.c
-CFLAGS+=-I${.CURDIR} -DPROTO
-MAN= des_crypt.3
-MLINKS+=des_crypt.3 des_read_password.3 des_crypt.3 des_read_2password.3 \
- des_crypt.3 des_string_to_key.3 des_crypt.3 des_string_to_2key.3 \
- des_crypt.3 des_read_pw_string.3 des_crypt.3 des_random_key.3 \
- des_crypt.3 des_set_key_schedule.3 \
- des_crypt.3 des_ecb_encrypt.3 des_crypt.3 des_3ecb_encrypt.3 \
- des_crypt.3 des_cbc_encrypt.3 des_crypt.3 des_3cbc_encrypt.3 \
- des_crypt.3 des_pcbc_encrypt.3 des_crypt.3 des_cfb_encrypt.3 \
- des_crypt.3 des_ofb_encrypt.3 des_crypt.3 des_cbc_cksum.3 \
- des_crypt.3 des_quad_cksum.3 des_crypt.3 des_enc_read.3 \
- des_crypt.3 des_enc_write.3 des_crypt.3 des_set_odd_parity.3 \
- des_crypt.3 des_is_weak_key.3
-
-.include <bsd.lib.mk>
diff --git a/kerberosIV/des/README b/kerberosIV/des/README
deleted file mode 100644
index 2b1d230c1df..00000000000
--- a/kerberosIV/des/README
+++ /dev/null
@@ -1,47 +0,0 @@
-
- libdes, Version 3.21 21/11/95
-
- Copyright (c) 1995, Eric Young
- All rights reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms specified in COPYRIGHT.
-
---
-The primary ftp site for this library is
-ftp://ftp.psy.uq.oz.au/pub/Crypto/DES/libdes-x.xx.tar.gz
-libdes is now also shipped with SSLeay. Primary ftp site of
-ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL/SSLeay-x.xx.tar.gz
-
-The best way to build this library is to build it as part of SSLeay.
-
-This kit builds a DES encryption library and a DES encryption program.
-It supports ecb, cbc, ofb, cfb, triple ecb, triple cbc, triple ofb,
-triple cfb, and MIT's pcbc encryption modes and also has a fast
-implementation of crypt(3).
-It contains support routines to read keys from a terminal,
-generate a random key, generate a key from an arbitrary length string,
-read/write encrypted data from/to a file descriptor.
-
-The implementation was written so as to conform with the manual entry
-for the des_crypt(3) library routines from MIT's project Athena.
-
-destest should be run after compilation to test the des routines.
-rpw should be run after compilation to test the read password routines.
-The des program is a replacement for the sun des command. I believe it
-conforms to the sun version.
-
-The Imakefile is setup for use in the kerberos distribution.
-
-These routines are best compiled with gcc or any other good
-optimising compiler.
-Just turn you optimiser up to the highest settings and run destest
-after the build to make sure everything works.
-
-I believe these routines are close to the fastest and most portable DES
-routines that use small lookup tables (4.5k) that are publicly available.
-The fcrypt routine is faster than ufc's fcrypt (when compiling with
-gcc2 -O2) on the sparc 2 (1410 vs 1270) but is not so good on other machines
-(on a sun3/260 168 vs 336). It is a function of CPU on chip cache size.
-
-Eric Young (eay@mincom.oz.au or eay@psych.psy.uq.oz.au)
diff --git a/kerberosIV/des/VERSION b/kerberosIV/des/VERSION
deleted file mode 100644
index bc399c1d9b9..00000000000
--- a/kerberosIV/des/VERSION
+++ /dev/null
@@ -1,312 +0,0 @@
-Version 3.21 22/11/95
- After some emailing back and forth with
- Colin Plumb <colin@nyx10.cs.du.edu>, I've tweaked a few things
- and in a future version I will probably put in some of the
- optimisation he suggested for use with the DES_USE_PTR option.
- Extra routines from Mark Murray <mark@grondar.za> for use in
- freeBSD. They mostly involve random number generation for use
- with kerberos. They involve evil machine specific system calls
- etc so I would normally suggest pushing this stuff into the
- application and/or using RAND_seed()/RAND_bytes() if you are
- using this DES library as part of SSLeay.
- Redone the read_pw() function so that it is cleaner and
- supports termios, thanks to Sameer Parekh <sameer@c2.org>
- for the initial patches for this.
- Renamed 3ecb_encrypt() to ecb3_encrypt(). This has been
- done just to make things more consistent.
- I have also now added triple DES versions of cfb and ofb.
-
-Version 3.20
- Damn, Damn, Damn, as pointed out by Mike_Spreitzer.PARC@xerox.com,
- my des_random_seed() function was only copying 4 bytes of the
- passed seed into the init structure. It is now fixed to copy 8.
- My own suggestion is to used something like MD5 :-)
-
-Version 3.19
- While looking at my code one day, I though, why do I keep on
- calling des_encrypt(in,out,ks,enc) when every function that
- calls it has in and out the same. So I dropped the 'out'
- parameter, people should not be using this function.
-
-Version 3.18 30/08/95
- Fixed a few bit with the distribution and the filenames.
- 3.17 had been munged via a move to DOS and back again.
- NO CODE CHANGES
-
-Version 3.17 14/07/95
- Fixed ede3 cbc which I had broken in 3.16. I have also
- removed some unneeded variables in 7-8 of the routines.
-
-Version 3.16 26/06/95
- Added des_encrypt2() which does not use IP/FP, used by triple
- des routines. Tweaked things a bit elsewhere. %13 speedup on
- sparc and %6 on a R4400 for ede3 cbc mode.
-
-Version 3.15 06/06/95
- Added des_ncbc_encrypt(), it is des_cbc mode except that it is
- 'normal' and copies the new iv value back over the top of the
- passed parameter.
- CHANGED des_ede3_cbc_encrypt() so that it too now overwrites
- the iv. THIS WILL BREAK EXISTING CODE, but since this function
- only new, I feel I can change it, not so with des_cbc_encrypt :-(.
- I need to update the documentation.
-
-Version 3.14 31/05/95
- New release upon the world, as part of my SSL implementation.
- New copyright and usage stuff. Basically free for all to use
- as long as you say it came from me :-)
-
-Version 3.13 31/05/95
- A fix in speed.c, if HZ is not defined, I set it to 100.0
- which is reasonable for most unixes except SunOS 4.x.
- I now have a #ifdef sun but timing for SunOS 4.x looked very
- good :-(. At my last job where I used SunOS 4.x, it was
- defined to be 60.0 (look at the old INSTALL documentation), at
- the last release had it changed to 100.0 since I now work with
- Solaris2 and SVR4 boxes.
- Thanks to Rory Chisholm <rchishol@math.ethz.ch> for pointing this
- one out.
-
-Version 3.12 08/05/95
- As pointed out by The Crypt Keeper <tck@bend.UCSD.EDU>,
- my D_ENCRYPT macro in crypt() had an un-necessary variable.
- It has been removed.
-
-Version 3.11 03/05/95
- Added des_ede3_cbc_encrypt() which is cbc mode des with 3 keys
- and one iv. It is a standard and I needed it for my SSL code.
- It makes more sense to use this for triple DES than
- 3cbc_encrypt(). I have also added (or should I say tested :-)
- cfb64_encrypt() which is cfb64 but it will encrypt a partial
- number of bytes - 3 bytes in 3 bytes out. Again this is for
- my SSL library, as a form of encryption to use with SSL
- telnet.
-
-Version 3.10 22/03/95
- Fixed a bug in 3cbc_encrypt() :-(. When making repeated calls
- to cbc3_encrypt, the 2 iv values that were being returned to
- be used in the next call were reversed :-(.
- Many thanks to Bill Wade <wade@Stoner.COM> for pointing out
- this error.
-
-Version 3.09 01/02/95
- Fixed des_random_key to far more random, it was rather feeble
- with regards to picking the initial seed. The problem was
- pointed out by Olaf Kirch <okir@monad.swb.de>.
-
-Version 3.08 14/12/94
- Added Makefile.PL so libdes can be built into perl5.
- Changed des_locl.h so RAND is always defined.
-
-Version 3.07 05/12/94
- Added GNUmake and stuff so the library can be build with
- glibc.
-
-Version 3.06 30/08/94
- Added rpc_enc.c which contains _des_crypt. This is for use in
- secure_rpc v 4.0
- Finally fixed the cfb_enc problems.
- Fixed a few parameter parsing bugs in des (-3 and -b), thanks
- to Rob McMillan <R.McMillan@its.gu.edu.au>
-
-Version 3.05 21/04/94
- for unsigned long l; gcc does not produce ((l>>34) == 0)
- This causes bugs in cfb_enc.
- Thanks to Hadmut Danisch <danisch@ira.uka.de>
-
-Version 3.04 20/04/94
- Added a version number to des.c and libdes.a
-
-Version 3.03 12/01/94
- Fixed a bug in non zero iv in 3cbc_enc.
-
-Version 3.02 29/10/93
- I now work in a place where there are 6+ architectures and 14+
- OS versions :-).
- Fixed TERMIO definition so the most sys V boxes will work :-)
-
-Release upon comp.sources.misc
-Version 3.01 08/10/93
- Added des_3cbc_encrypt()
-
-Version 3.00 07/10/93
- Fixed up documentation.
- quad_cksum definitely compatible with MIT's now.
-
-Version 2.30 24/08/93
- Triple DES now defaults to triple cbc but can do triple ecb
- with the -b flag.
- Fixed some MSDOS uuen/uudecoding problems, thanks to
- Added prototypes.
-
-Version 2.22 29/06/93
- Fixed a bug in des_is_weak_key() which stopped it working :-(
- thanks to engineering@MorningStar.Com.
-
-Version 2.21 03/06/93
- des(1) with no arguments gives quite a bit of help.
- Added -c (generate ckecksum) flag to des(1).
- Added -3 (triple DES) flag to des(1).
- Added cfb and ofb routines to the library.
-
-Version 2.20 11/03/93
- Added -u (uuencode) flag to des(1).
- I have been playing with byte order in quad_cksum to make it
- compatible with MIT's version. All I can say is avid this
- function if possible since MIT's output is endian dependent.
-
-Version 2.12 14/10/92
- Added MSDOS specific macro in ecb_encrypt which gives a %70
- speed up when the code is compiled with turbo C.
-
-Version 2.11 12/10/92
- Speedup in set_key (recoding of PC-1)
- I now do it in 47 simple operations, down from 60.
- Thanks to John Fletcher (john_fletcher@lccmail.ocf.llnl.gov)
- for motivating me to look for a faster system :-)
- The speedup is probably less that 1% but it is still 13
- instructions less :-).
-
-Version 2.10 06/10/92
- The code now works on the 64bit ETA10 and CRAY without modifications or
- #defines. I believe the code should work on any machine that
- defines long, int or short to be 8 bytes long.
- Thanks to Shabbir J. Safdar (shabby@mentor.cc.purdue.edu)
- for helping me fix the code to run on 64bit machines (he had
- access to an ETA10).
- Thanks also to John Fletcher <john_fletcher@lccmail.ocf.llnl.gov>
- for testing the routines on a CRAY.
- read_password.c has been renamed to read_passwd.c
- string_to_key.c has been renamed to string2key.c
-
-Version 2.00 14/09/92
- Made mods so that the library should work on 64bit CPU's.
- Removed all my uchar and ulong defs. To many different
- versions of unix define them in their header files in too many
- different combinations :-)
- IRIX - Sillicon Graphics mods (mostly in read_password.c).
- Thanks to Andrew Daviel (advax@erich.triumf.ca)
-
-Version 1.99 26/08/92
- Fixed a bug or 2 in enc_read.c
- Fixed a bug in enc_write.c
- Fixed a pseudo bug in fcrypt.c (very obscure).
-
-Version 1.98 31/07/92
- Support for the ETA10. This is a strange machine that defines
- longs and ints as 8 bytes and shorts as 4 bytes.
- Since I do evil things with long * that assume that they are 4
- bytes. Look in the Makefile for the option to compile for
- this machine. quad_cksum appears to have problems but I
- will don't have the time to fix it right now, and this is not
- a function that uses DES and so will not effect the main uses
- of the library.
-
-Version 1.97 20/05/92 eay
- Fixed the Imakefile and made some changes to des.h to fix some
- problems when building this package with Kerberos v 4.
-
-Version 1.96 18/05/92 eay
- Fixed a small bug in string_to_key() where problems could
- occur if des_check_key was set to true and the string
- generated a weak key.
-
-Patch2 posted to comp.sources.misc
-Version 1.95 13/05/92 eay
- Added an alternative version of the D_ENCRYPT macro in
- ecb_encrypt and fcrypt. Depending on the compiler, one version or the
- other will be faster. This was inspired by
- Dana How <how@isl.stanford.edu>, and her pointers about doing the
- *(ulong *)((uchar *)ptr+(value&0xfc))
- vs
- ptr[value&0x3f]
- to stop the C compiler doing a <<2 to convert the long array index.
-
-Version 1.94 05/05/92 eay
- Fixed an incompatibility between my string_to_key and the MIT
- version. When the key is longer than 8 chars, I was wrapping
- with a different method. To use the old version, define
- OLD_STR_TO_KEY in the makefile. Thanks to
- viktor@newsu.shearson.com (Viktor Dukhovni).
-
-Version 1.93 28/04/92 eay
- Fixed the VMS mods so that echo is now turned off in
- read_password. Thanks again to brennan@coco.cchs.su.oz.AU.
- MSDOS support added. The routines can be compiled with
- Turbo C (v2.0) and MSC (v5.1). Make sure MSDOS is defined.
-
-Patch1 posted to comp.sources.misc
-Version 1.92 13/04/92 eay
- Changed D_ENCRYPT so that the rotation of R occurs outside of
- the loop. This required rotating all the longs in sp.h (now
- called spr.h). Thanks to Richard Outerbridge <71755.204@CompuServe.COM>
- speed.c has been changed so it will work without SIGALRM. If
- times(3) is not present it will try to use ftime() instead.
-
-Version 1.91 08/04/92 eay
- Added -E/-D options to des(1) so it can use string_to_key.
- Added SVR4 mods suggested by witr@rwwa.COM
- Added VMS mods suggested by brennan@coco.cchs.su.oz.AU. If
- anyone knows how to turn of tty echo in VMS please tell me or
- implement it yourself :-).
- Changed FILE *IN/*OUT to *DES_IN/*DES_OUT since it appears VMS
- does not like IN/OUT being used.
-
-Libdes posted to comp.sources.misc
-Version 1.9 24/03/92 eay
- Now contains a fast small crypt replacement.
- Added des(1) command.
- Added des_rw_mode so people can use cbc encryption with
- enc_read and enc_write.
-
-Version 1.8 15/10/91 eay
- Bug in cbc_cksum.
- Many thanks to Keith Reynolds (keithr@sco.COM) for pointing this
- one out.
-
-Version 1.7 24/09/91 eay
- Fixed set_key :-)
- set_key is 4 times faster and takes less space.
- There are a few minor changes that could be made.
-
-Version 1.6 19/09/1991 eay
- Finally go IP and FP finished.
- Now I need to fix set_key.
- This version is quite a bit faster that 1.51
-
-Version 1.52 15/06/1991 eay
- 20% speedup in ecb_encrypt by changing the E bit selection
- to use 2 32bit words. This also required modification of the
- sp table. There is still a way to speedup the IP and IP-1
- (hints from outer@sq.com) still working on this one :-(.
-
-Version 1.51 07/06/1991 eay
- Faster des_encrypt by loop unrolling
- Fixed bug in quad_cksum.c (thanks to hughes@logos.ucs.indiana.edu)
-
-Version 1.50 28/05/1991 eay
- Optimised the code a bit more for the sparc. I have improved the
- speed of the inner des_encrypt by speeding up the initial and
- final permutations.
-
-Version 1.40 23/10/1990 eay
- Fixed des_random_key, it did not produce a random key :-(
-
-Version 1.30 2/10/1990 eay
- Have made des_quad_cksum the same as MIT's, the full package
- should be compatible with MIT's
- Have tested on a DECstation 3100
- Still need to fix des_set_key (make it faster).
- Does des_cbc_encrypts at 70.5k/sec on a 3100.
-
-Version 1.20 18/09/1990 eay
- Fixed byte order dependencies.
- Fixed (I hope) all the word alignment problems.
- Speedup in des_ecb_encrypt.
-
-Version 1.10 11/09/1990 eay
- Added des_enc_read and des_enc_write.
- Still need to fix des_quad_cksum.
- Still need to document des_enc_read and des_enc_write.
-
-Version 1.00 27/08/1990 eay
diff --git a/kerberosIV/des/cbc3_enc.c b/kerberosIV/des/cbc3_enc.c
deleted file mode 100644
index 11aa3ff4d7c..00000000000
--- a/kerberosIV/des/cbc3_enc.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* lib/des/cbc3_enc.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-
-/* HAS BUGS? DON'T USE */
-void des_3cbc_encrypt(input, output, length, ks1, ks2, iv1, iv2, encrypt)
-des_cblock (*input);
-des_cblock (*output);
-long length;
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_cblock (*iv1);
-des_cblock (*iv2);
-int encrypt;
- {
- int off=(length-1)/8;
- long l8=((length+7)/8)*8;
- des_cblock niv1,niv2;
-
- if (encrypt == DES_ENCRYPT)
- {
- des_cbc_encrypt(input,output,length,ks1,iv1,encrypt);
- if (length >= sizeof(des_cblock))
- memcpy(niv1,output[off],sizeof(des_cblock));
- des_cbc_encrypt(output,output,l8,ks2,iv1,!encrypt);
- des_cbc_encrypt(output,output,l8,ks1,iv2, encrypt);
- if (length >= sizeof(des_cblock))
- memcpy(niv2,output[off],sizeof(des_cblock));
- }
- else
- {
- if (length >= sizeof(des_cblock))
- memcpy(niv2,input[off],sizeof(des_cblock));
- des_cbc_encrypt(input,output,l8,ks1,iv2,encrypt);
- des_cbc_encrypt(output,output,l8,ks2,iv1,!encrypt);
- if (length >= sizeof(des_cblock))
- memcpy(niv1,output[off],sizeof(des_cblock));
- des_cbc_encrypt(output,output,length,ks1,iv1, encrypt);
- }
- memcpy(*iv1,niv1,sizeof(des_cblock));
- memcpy(*iv2,niv2,sizeof(des_cblock));
- }
-
diff --git a/kerberosIV/des/cbc_cksm.c b/kerberosIV/des/cbc_cksm.c
deleted file mode 100644
index 9088c732c6f..00000000000
--- a/kerberosIV/des/cbc_cksm.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* lib/des/cbc_cksm.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-
-unsigned long des_cbc_cksum(input, output, length, schedule, ivec)
-des_cblock (*input);
-des_cblock (*output);
-long length;
-des_key_schedule schedule;
-des_cblock (*ivec);
- {
- register unsigned long tout0,tout1,tin0,tin1;
- register long l=length;
- unsigned long tin[2];
- unsigned char *in,*out,*iv;
-
- in=(unsigned char *)input;
- out=(unsigned char *)output;
- iv=(unsigned char *)ivec;
-
- c2l(iv,tout0);
- c2l(iv,tout1);
- for (; l>0; l-=8)
- {
- if (l >= 8)
- {
- c2l(in,tin0);
- c2l(in,tin1);
- }
- else
- c2ln(in,tin0,tin1,l);
-
- tin0^=tout0; tin[0]=tin0;
- tin1^=tout1; tin[1]=tin1;
- des_encrypt((unsigned long *)tin,schedule,DES_ENCRYPT);
- /* fix 15/10/91 eay - thanks to keithr@sco.COM */
- tout0=tin[0];
- tout1=tin[1];
- }
- if (out != NULL)
- {
- l2c(tout0,out);
- l2c(tout1,out);
- }
- tout0=tin0=tin1=tin[0]=tin[1]=0;
- return(tout1);
- }
diff --git a/kerberosIV/des/cbc_enc.c b/kerberosIV/des/cbc_enc.c
deleted file mode 100644
index c0cdef896a5..00000000000
--- a/kerberosIV/des/cbc_enc.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* lib/des/cbc_enc.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-
-void des_cbc_encrypt(input, output, length, schedule, ivec, encrypt)
-des_cblock (*input);
-des_cblock (*output);
-long length;
-des_key_schedule schedule;
-des_cblock (*ivec);
-int encrypt;
- {
- register unsigned long tin0,tin1;
- register unsigned long tout0,tout1,xor0,xor1;
- register unsigned char *in,*out;
- register long l=length;
- unsigned long tin[2];
- unsigned char *iv;
-
- in=(unsigned char *)input;
- out=(unsigned char *)output;
- iv=(unsigned char *)ivec;
-
- if (encrypt)
- {
- c2l(iv,tout0);
- c2l(iv,tout1);
- for (; l>0; l-=8)
- {
- if (l >= 8)
- {
- c2l(in,tin0);
- c2l(in,tin1);
- }
- else
- c2ln(in,tin0,tin1,l);
- tin0^=tout0; tin[0]=tin0;
- tin1^=tout1; tin[1]=tin1;
- des_encrypt((unsigned long *)tin,schedule,DES_ENCRYPT);
- tout0=tin[0]; l2c(tout0,out);
- tout1=tin[1]; l2c(tout1,out);
- }
- }
- else
- {
- c2l(iv,xor0);
- c2l(iv,xor1);
- for (; l>0; l-=8)
- {
- c2l(in,tin0); tin[0]=tin0;
- c2l(in,tin1); tin[1]=tin1;
- des_encrypt((unsigned long *)tin,schedule,DES_DECRYPT);
- tout0=tin[0]^xor0;
- tout1=tin[1]^xor1;
- if (l >= 8)
- {
- l2c(tout0,out);
- l2c(tout1,out);
- }
- else
- l2cn(tout0,tout1,out,l);
- xor0=tin0;
- xor1=tin1;
- }
- }
- tin0=tin1=tout0=tout1=xor0=xor1=0;
- tin[0]=tin[1]=0;
- }
-
diff --git a/kerberosIV/des/cfb64ede.c b/kerberosIV/des/cfb64ede.c
deleted file mode 100644
index 8160d291434..00000000000
--- a/kerberosIV/des/cfb64ede.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* lib/des/cfb64enc.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-
-/* The input and output encrypted as though 64bit cfb mode is being
- * used. The extra state information to record how much of the
- * 64bit block we have used is contained in *num;
- */
-
-void des_ede3_cfb64_encrypt(in, out, length, ks1,ks2,ks3, ivec, num, encrypt)
-unsigned char *in;
-unsigned char *out;
-long length;
-des_key_schedule ks1,ks2,ks3;
-des_cblock (*ivec);
-int *num;
-int encrypt;
- {
- register unsigned long v0,v1;
- register long l=length,n=*num;
- unsigned long ti[2];
- unsigned char *iv,c,cc;
-
- iv=(unsigned char *)ivec;
- if (encrypt)
- {
- while (l--)
- {
- if (n == 0)
- {
- c2l(iv,v0);
- c2l(iv,v1);
-
- IP(v0,v1);
-
- ti[0]=v0;
- ti[1]=v1;
- des_encrypt2((unsigned long *)ti,ks1,DES_ENCRYPT);
- des_encrypt2((unsigned long *)ti,ks2,DES_DECRYPT);
- des_encrypt2((unsigned long *)ti,ks3,DES_ENCRYPT);
- v0=ti[0];
- v1=ti[1];
-
- FP(v1,v0);
-
- iv=(unsigned char *)ivec;
- l2c(v0,iv);
- l2c(v1,iv);
- iv=(unsigned char *)ivec;
- }
- c= *(in++)^iv[n];
- *(out++)=c;
- iv[n]=c;
- n=(n+1)&0x07;
- }
- }
- else
- {
- while (l--)
- {
- if (n == 0)
- {
- c2l(iv,v0);
- c2l(iv,v1);
-
- IP(v0,v1);
-
- ti[0]=v0;
- ti[1]=v1;
- des_encrypt2((unsigned long *)ti,ks1,DES_ENCRYPT);
- des_encrypt2((unsigned long *)ti,ks2,DES_DECRYPT);
- des_encrypt2((unsigned long *)ti,ks3,DES_ENCRYPT);
-
- v0=ti[0];
- v1=ti[1];
-
- FP(v1,v0);
-
- iv=(unsigned char *)ivec;
- l2c(v0,iv);
- l2c(v1,iv);
- iv=(unsigned char *)ivec;
- }
- cc= *(in++);
- c=iv[n];
- iv[n]=cc;
- *(out++)=c^cc;
- n=(n+1)&0x07;
- }
- }
- v0=v1=ti[0]=ti[1]=c=cc=0;
- *num=n;
- }
-
-#ifdef undef /* MACRO */
-void des_ede2_cfb64_encrypt(in, out, length, ks1,ks2, ivec, num, encrypt)
-unsigned char *in;
-unsigned char *out;
-long length;
-des_key_schedule ks1,ks2;
-des_cblock (*ivec);
-int *num;
-int encrypt;
- {
- des_ede3_cfb64_encrypt(in,out,length,ks1,ks2,ks1,ivec,num,encrypt);
- }
-#endif
diff --git a/kerberosIV/des/cfb64enc.c b/kerberosIV/des/cfb64enc.c
deleted file mode 100644
index 35875f3f647..00000000000
--- a/kerberosIV/des/cfb64enc.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* lib/des/cfb64enc.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-
-/* The input and output encrypted as though 64bit cfb mode is being
- * used. The extra state information to record how much of the
- * 64bit block we have used is contained in *num;
- */
-
-void des_cfb64_encrypt(in, out, length, schedule, ivec, num, encrypt)
-unsigned char *in;
-unsigned char *out;
-long length;
-des_key_schedule schedule;
-des_cblock (*ivec);
-int *num;
-int encrypt;
- {
- register unsigned long v0,v1;
- register long l=length,n=*num;
- unsigned long ti[2];
- unsigned char *iv,c,cc;
-
- iv=(unsigned char *)ivec;
- if (encrypt)
- {
- while (l--)
- {
- if (n == 0)
- {
- c2l(iv,v0); ti[0]=v0;
- c2l(iv,v1); ti[1]=v1;
- des_encrypt((unsigned long *)ti,
- schedule,DES_ENCRYPT);
- iv=(unsigned char *)ivec;
- v0=ti[0]; l2c(v0,iv);
- v0=ti[1]; l2c(v0,iv);
- iv=(unsigned char *)ivec;
- }
- c= *(in++)^iv[n];
- *(out++)=c;
- iv[n]=c;
- n=(n+1)&0x07;
- }
- }
- else
- {
- while (l--)
- {
- if (n == 0)
- {
- c2l(iv,v0); ti[0]=v0;
- c2l(iv,v1); ti[1]=v1;
- des_encrypt((unsigned long *)ti,
- schedule,DES_ENCRYPT);
- iv=(unsigned char *)ivec;
- v0=ti[0]; l2c(v0,iv);
- v0=ti[1]; l2c(v0,iv);
- iv=(unsigned char *)ivec;
- }
- cc= *(in++);
- c=iv[n];
- iv[n]=cc;
- *(out++)=c^cc;
- n=(n+1)&0x07;
- }
- }
- v0=v1=ti[0]=ti[1]=c=cc=0;
- *num=n;
- }
-
diff --git a/kerberosIV/des/cfb_enc.c b/kerberosIV/des/cfb_enc.c
deleted file mode 100644
index 33002d15921..00000000000
--- a/kerberosIV/des/cfb_enc.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/* lib/des/cfb_enc.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-
-/* The input and output are loaded in multiples of 8 bits.
- * What this means is that if you hame numbits=12 and length=2
- * the first 12 bits will be retrieved from the first byte and half
- * the second. The second 12 bits will come from the 3rd and half the 4th
- * byte.
- */
-void des_cfb_encrypt(in, out, numbits, length, schedule, ivec, encrypt)
-unsigned char *in;
-unsigned char *out;
-int numbits;
-long length;
-des_key_schedule schedule;
-des_cblock (*ivec);
-int encrypt;
- {
- register unsigned long d0,d1,v0,v1,n=(numbits+7)/8;
- register unsigned long mask0,mask1;
- register unsigned long l=length;
- register int num=numbits;
- unsigned long ti[2];
- unsigned char *iv;
-
- if (num > 64) return;
- if (num > 32)
- {
- mask0=0xffffffffL;
- if (num == 64)
- mask1=mask0;
- else mask1=(1L<<(num-32))-1;
- }
- else
- {
- if (num == 32)
- mask0=0xffffffffL;
- else mask0=(1L<<num)-1;
- mask1=0x00000000;
- }
-
- iv=(unsigned char *)ivec;
- c2l(iv,v0);
- c2l(iv,v1);
- if (encrypt)
- {
- while (l >= n)
- {
- l-=n;
- ti[0]=v0;
- ti[1]=v1;
- des_encrypt((unsigned long *)ti,schedule,DES_ENCRYPT);
- c2ln(in,d0,d1,n);
- in+=n;
- d0=(d0^ti[0])&mask0;
- d1=(d1^ti[1])&mask1;
- l2cn(d0,d1,out,n);
- out+=n;
- /* 30-08-94 - eay - changed because l>>32 and
- * l<<32 are bad under gcc :-( */
- if (num == 32)
- { v0=v1; v1=d0; }
- else if (num == 64)
- { v0=d0; v1=d1; }
- else if (num > 32) /* && num != 64 */
- {
- v0=((v1>>(num-32))|(d0<<(64-num)))&0xffffffffL;
- v1=((d0>>(num-32))|(d1<<(64-num)))&0xffffffffL;
- }
- else /* num < 32 */
- {
- v0=((v0>>num)|(v1<<(32-num)))&0xffffffffL;
- v1=((v1>>num)|(d0<<(32-num)))&0xffffffffL;
- }
- }
- }
- else
- {
- while (l >= n)
- {
- l-=n;
- ti[0]=v0;
- ti[1]=v1;
- des_encrypt((unsigned long *)ti,schedule,DES_ENCRYPT);
- c2ln(in,d0,d1,n);
- in+=n;
- /* 30-08-94 - eay - changed because l>>32 and
- * l<<32 are bad under gcc :-( */
- if (num == 32)
- { v0=v1; v1=d0; }
- else if (num == 64)
- { v0=d0; v1=d1; }
- else if (num > 32) /* && num != 64 */
- {
- v0=((v1>>(num-32))|(d0<<(64-num)))&0xffffffffL;
- v1=((d0>>(num-32))|(d1<<(64-num)))&0xffffffffL;
- }
- else /* num < 32 */
- {
- v0=((v0>>num)|(v1<<(32-num)))&0xffffffffL;
- v1=((v1>>num)|(d0<<(32-num)))&0xffffffffL;
- }
- d0=(d0^ti[0])&mask0;
- d1=(d1^ti[1])&mask1;
- l2cn(d0,d1,out,n);
- out+=n;
- }
- }
- iv=(unsigned char *)ivec;
- l2c(v0,iv);
- l2c(v1,iv);
- v0=v1=d0=d1=ti[0]=ti[1]=0;
- }
-
diff --git a/kerberosIV/des/des_crypt.3 b/kerberosIV/des/des_crypt.3
deleted file mode 100644
index eb859ce91b5..00000000000
--- a/kerberosIV/des/des_crypt.3
+++ /dev/null
@@ -1,509 +0,0 @@
-.\" $OpenBSD: des_crypt.3,v 1.4 1997/05/30 03:11:16 gene Exp $
-.TH DES_CRYPT 3
-.SH NAME
-des_read_password, des_read_2password,
-des_string_to_key, des_string_to_2key, des_read_pw_string,
-des_random_key, des_set_key_schedule,
-des_key_sched, des_ecb_encrypt, des_3ecb_encrypt, des_cbc_encrypt,
-des_3cbc_encrypt,
-des_pcbc_encrypt, des_cfb_encrypt, des_ofb_encrypt,
-des_cbc_cksum, des_quad_cksum,
-des_enc_read, des_enc_write, des_set_odd_parity,
-des_is_weak_key, crypt \- (non USA) DES encryption
-.SH SYNOPSIS
-.nf
-.nj
-.ft B
-#include <kerberosIV/des.h>
-.PP
-.B int des_read_password(key,prompt,verify)
-des_cblock *key;
-char *prompt;
-int verify;
-.PP
-.B int des_read_2password(key1,key2,prompt,verify)
-des_cblock *key1,*key2;
-char *prompt;
-int verify;
-.PP
-.B int des_string_to_key(str,key)
-char *str;
-des_cblock *key;
-.PP
-.B int des_string_to_2keys(str,key1,key2)
-char *str;
-des_cblock *key1,*key2;
-.PP
-.B int des_read_pw_string(buf,length,prompt,verify)
-char *buf;
-int length;
-char *prompt;
-int verify;
-.PP
-.B int des_random_key(key)
-des_cblock *key;
-.PP
-.B int des_set_key_schedule(key,schedule)
-des_cblock *key;
-des_key_schedule schedule;
-.PP
-.B int des_key_sched(key,schedule)
-des_cblock *key;
-des_key_schedule schedule;
-.PP
-.B int des_ecb_encrypt(input,output,schedule,encrypt)
-des_cblock *input;
-des_cblock *output;
-des_key_schedule schedule;
-int encrypt;
-.PP
-.B int des_3ecb_encrypt(input,output,ks1,ks2,encrypt)
-des_cblock *input;
-des_cblock *output;
-des_key_schedule ks1,ks2;
-int encrypt;
-.PP
-.B int des_cbc_encrypt(input,output,length,schedule,ivec,encrypt)
-des_cblock *input;
-des_cblock *output;
-long length;
-des_key_schedule schedule;
-des_cblock *ivec;
-int encrypt;
-.PP
-.B int des_3cbc_encrypt(input,output,length,sk1,sk2,ivec1,ivec2,encrypt)
-des_cblock *input;
-des_cblock *output;
-long length;
-des_key_schedule sk1;
-des_key_schedule sk2;
-des_cblock *ivec1;
-des_cblock *ivec2;
-int encrypt;
-.PP
-.B int des_pcbc_encrypt(input,output,length,schedule,ivec,encrypt)
-des_cblock *input;
-des_cblock *output;
-long length;
-des_key_schedule schedule;
-des_cblock *ivec;
-int encrypt;
-.PP
-.B int des_cfb_encrypt(input,output,numbits,length,schedule,ivec,encrypt)
-unsigned char *input;
-unsigned char *output;
-int numbits;
-long length;
-des_key_schedule schedule;
-des_cblock *ivec;
-int encrypt;
-.PP
-.B int des_ofb_encrypt(input,output,numbits,length,schedule,ivec)
-unsigned char *input,*output;
-int numbits;
-long length;
-des_key_schedule schedule;
-des_cblock *ivec;
-.PP
-.B unsigned long des_cbc_cksum(input,output,length,schedule,ivec)
-des_cblock *input;
-des_cblock *output;
-long length;
-des_key_schedule schedule;
-des_cblock *ivec;
-.PP
-.B unsigned long des_quad_cksum(input,output,length,out_count,seed)
-des_cblock *input;
-des_cblock *output;
-long length;
-int out_count;
-des_cblock *seed;
-.PP
-.B int des_check_key;
-.PP
-.B int des_enc_read(fd,buf,len,sched,iv)
-int fd;
-char *buf;
-int len;
-des_key_schedule sched;
-des_cblock *iv;
-.PP
-.B int des_enc_write(fd,buf,len,sched,iv)
-int fd;
-char *buf;
-int len;
-des_key_schedule sched;
-des_cblock *iv;
-.PP
-.B extern int des_rw_mode;
-.PP
-.B void des_set_odd_parity(key)
-des_cblock *key;
-.PP
-.B int des_is_weak_key(key)
-des_cblock *key;
-.PP
-.B char *crypt(passwd,salt)
-char *passwd;
-char *salt;
-.PP
-.fi
-.SH DESCRIPTION
-This library contains a fast implementation of the DES encryption
-algorithm.
-.PP
-There are two phases to the use of DES encryption.
-The first is the generation of a
-.I des_key_schedule
-from a key,
-the second is the actual encryption.
-A des key is of type
-.I des_cblock.
-This type is made from 8 characters with odd parity.
-The least significant bit in the character is the parity bit.
-The key schedule is an expanded form of the key; it is used to speed the
-encryption process.
-.PP
-.I des_read_password
-writes the string specified by prompt to the standard output,
-turns off echo and reads an input string from standard input
-until terminated with a newline.
-If verify is non-zero, it prompts and reads the input again and verifies
-that both entered passwords are the same.
-The entered string is converted into a des key by using the
-.I des_string_to_key
-routine.
-The new key is placed in the
-.I des_cblock
-that was passed (by reference) to the routine.
-If there were no errors,
-.I des_read_password
-returns 0,
--1 is returned if there was a terminal error and 1 is returned for
-any other error.
-.PP
-.I des_read_2password
-operates in the same way as
-.I des_read_password
-except that it generates 2 keys by using the
-.I des_string_to_2key
-function.
-.PP
-.I des_read_pw_string
-is called by
-.I des_read_password
-to read and verify a string from a terminal device.
-The string is returned in
-.I buf.
-The size of
-.I buf
-is passed to the routine via the
-.I length
-parameter.
-.PP
-.I des_string_to_key
-converts a string into a valid des key.
-.PP
-.I des_string_to_2key
-converts a string into 2 valid des keys.
-This routine is best suited for used to generate keys for use with
-.I des_3ecb_encrypt.
-.PP
-.I des_random_key
-returns a random key that is made of a combination of process id,
-time and an increasing counter.
-.PP
-Before a des key can be used it is converted into a
-.I des_key_schedule
-via the
-.I des_set_key_schedule
-routine.
-If the
-.I des_check_key
-flag is non-zero,
-.I des_set_key_schedule
-will check that the key passed is of odd parity and is not a week or
-semi-weak key.
-If the parity is wrong,
-then -1 is returned.
-If the key is a weak key,
-then -2 is returned.
-If an error is returned,
-the key schedule is not generated.
-.PP
-.I des_key_sched
-is another name for the
-.I des_set_key_schedule
-function.
-.PP
-The following routines mostly operate on an input and output stream of
-.I des_cblock's.
-.PP
-.I des_ecb_encrypt
-is the basic DES encryption routine that encrypts or decrypts a single 8-byte
-.I des_cblock
-in
-.I electronic code book
-mode.
-It always transforms the input data, pointed to by
-.I input,
-into the output data,
-pointed to by the
-.I output
-argument.
-If the
-.I encrypt
-argument is non-zero (DES_ENCRYPT),
-the
-.I input
-(cleartext) is encrypted in to the
-.I output
-(ciphertext) using the key_schedule specified by the
-.I schedule
-argument,
-previously set via
-.I des_set_key_schedule.
-If
-.I encrypt
-is zero (DES_DECRYPT),
-the
-.I input
-(now ciphertext)
-is decrypted into the
-.I output
-(now cleartext).
-Input and output may overlap.
-No meaningful value is returned.
-.PP
-.I des_3ecb_encrypt
-encrypts/decrypts the
-.I input
-block by using triple ecb DES encryption.
-This involves encrypting the input with
-.I ks1,
-decryption with the key schedule
-.I ks2,
-and then encryption with the first again.
-This routine greatly reduces the chances of brute force breaking of
-DES and has the advantage of if
-.I ks1
-and
-.I ks2
-are the same, it is equivalent to just encryption using ecb mode and
-.I ks1
-as the key.
-.PP
-.I des_cbc_encrypt
-encrypts/decrypts using the
-.I cipher-block-chaining
-mode of DES.
-If the
-.I encrypt
-argument is non-zero,
-the routine cipher-block-chain encrypts the cleartext data pointed to by the
-.I input
-argument into the ciphertext pointed to by the
-.I output
-argument,
-using the key schedule provided by the
-.I schedule
-argument,
-and initialisation vector provided by the
-.I ivec
-argument.
-If the
-.I length
-argument is not an integral multiple of eight bytes,
-the last block is copied to a temporary area and zero filled.
-The output is always
-an integral multiple of eight bytes.
-To make multiple cbc encrypt calls on a large amount of data appear to
-be one
-.I des_cbc_encrypt
-call, the
-.I ivec
-of subsequent calls should be the last 8 bytes of the output.
-.PP
-.I des_3cbc_encrypt
-encrypts/decrypts the
-.I input
-block by using triple cbc DES encryption.
-This involves encrypting the input with key schedule
-.I ks1,
-decryption with the key schedule
-.I ks2,
-and then encryption with the first again.
-2 initialisation vectors are required,
-.I ivec1
-and
-.I ivec2.
-Unlike
-.I des_cbc_encrypt,
-these initialisation vectors are modified by the subroutine.
-This routine greatly reduces the chances of brute force breaking of
-DES and has the advantage of if
-.I ks1
-and
-.I ks2
-are the same, it is equivalent to just encryption using cbc mode and
-.I ks1
-as the key.
-.PP
-.I des_pcbc_encrypt
-encrypt/decrypts using a modified block chaining mode.
-It provides better error propagation characteristics than cbc
-encryption.
-.PP
-.I des_cfb_encrypt
-encrypt/decrypts using cipher feedback mode. This method takes an
-array of characters as input and outputs and array of characters. It
-does not require any padding to 8 character groups. Note: the ivec
-variable is changed and the new changed value needs to be passed to
-the next call to this function. Since this function runs a complete
-DES ecb encryption per numbits, this function is only suggested for
-use when sending small numbers of characters.
-.PP
-.I des_ofb_encrypt
-encrypt using output feedback mode. This method takes an
-array of characters as input and outputs and array of characters. It
-does not require any padding to 8 character groups. Note: the ivec
-variable is changed and the new changed value needs to be passed to
-the next call to this function. Since this function runs a complete
-DES ecb encryption per numbits, this function is only suggested for
-use when sending small numbers of characters.
-.PP
-.I des_cbc_cksum
-produces an 8 byte checksum based on the input stream (via cbc encryption).
-The last 4 bytes of the checksum is returned and the complete 8 bytes is
-placed in
-.I output.
-.PP
-.I des_quad_cksum
-returns a 4 byte checksum from the input bytes.
-The algorithm can be iterated over the input,
-depending on
-.I out_count,
-1, 2, 3 or 4 times.
-If
-.I output
-is non-NULL,
-the 8 bytes generated by each pass are written into
-.I output.
-.PP
-.I des_enc_write
-is used to write
-.I len
-bytes
-to file descriptor
-.I fd
-from buffer
-.I buf.
-The data is encrypted via
-.I pcbc_encrypt
-(default) using
-.I sched
-for the key and
-.I iv
-as a starting vector.
-The actual data send down
-.I fd
-consists of 4 bytes (in network byte order) containing the length of the
-following encrypted data. The encrypted data then follows, padded with random
-data out to a multiple of 8 bytes.
-.PP
-.I des_enc_read
-is used to read
-.I len
-bytes
-from file descriptor
-.I fd
-into buffer
-.I buf.
-The data being read from
-.I fd
-is assumed to have come from
-.I des_enc_write
-and is decrypted using
-.I sched
-for the key schedule and
-.I iv
-for the initial vector.
-The
-.I des_enc_read/des_enc_write
-pair can be used to read/write to files, pipes and sockets.
-I have used them in implementing a version of rlogin in which all
-data is encrypted.
-.PP
-.I des_rw_mode
-is used to specify the encryption mode to use with
-.I des_enc_read
-and
-.I des_end_write.
-If set to
-.I DES_PCBC_MODE
-(the default), des_pcbc_encrypt is used.
-If set to
-.I DES_CBC_MODE
-des_cbc_encrypt is used.
-These two routines and the variable are not part of the normal MIT library.
-.PP
-.I des_set_odd_parity
-sets the parity of the passed
-.I key
-to odd. This routine is not part of the standard MIT library.
-.PP
-.I des_is_weak_key
-returns 1 is the passed key is a weak key (pick again :-),
-0 if it is ok.
-This routine is not part of the standard MIT library.
-.PP
-.I crypt
-is a replacement for the normal system crypt.
-It is much faster than the system crypt.
-.PP
-.SH FILES
-/usr/include/kerberosIV/des.h
-.br
-/usr/lib/libdes.a
-.PP
-The encryption routines have been tested on 16bit, 32bit and 64bit
-machines of various endian and even works under VMS.
-.PP
-.SH BUGS
-.PP
-If you think this manual is sparse,
-read the des_crypt(3) manual from the MIT kerberos (or bones outside
-of the USA) distribution.
-.PP
-.I des_cfb_encrypt
-and
-.I des_ofb_encrypt
-operates on input of 8 bits. What this means is that if you set
-numbits to 12, and length to 2, the first 12 bits will come from the 1st
-input byte and the low half of the second input byte. The second 12
-bits will have the low 8 bits taken from the 3rd input byte and the
-top 4 bits taken from the 4th input byte. The same holds for output.
-This function has been implemented this way because most people will
-be using a multiple of 8 and because once you get into pulling bytes input
-bytes apart things get ugly!
-.PP
-.I des_read_pw_string
-is the most machine/OS dependent function and normally generates the
-most problems when porting this code.
-.PP
-.I des_string_to_key
-is probably different from the MIT version since there are lots
-of fun ways to implement one-way encryption of a text string.
-.PP
-The routines are optimised for 32 bit machines and so are not efficient
-on IBM PCs.
-.PP
-NOTE: extensive work has been done on this library since this document
-was origionally written. Please try to read des.doc from the libdes
-distribution since it is far more upto date and documents more of the
-functions. Libdes is now also being shipped as part of SSLeay, a
-general cryptographic library that amonst other things implements
-netscapes SSL protocoll. The most recent version can be found in
-SSLeay distributions.
-.SH AUTHOR
-Eric Young (eay@mincom.oz.au or eay@psych.psy.uq.oz.au)
diff --git a/kerberosIV/des/des_locl.h b/kerberosIV/des/des_locl.h
deleted file mode 100644
index 41cf1e831e4..00000000000
--- a/kerberosIV/des/des_locl.h
+++ /dev/null
@@ -1,273 +0,0 @@
-/* lib/des/des_locl.h */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#ifndef HEADER_DES_LOCL_H
-#define HEADER_DES_LOCL_H
-#include <stdio.h>
-#include <stdlib.h>
-#ifndef MSDOS
-#include <unistd.h>
-#endif
-#include <kerberosIV/des.h>
-
-/* the following is tweaked from a config script, that is why it is a
- * protected undef/define */
-#ifndef DES_USE_PTR
-#undef DES_USE_PTR
-#endif
-
-#ifdef MSDOS /* Visual C++ 2.1 (Windows NT/95) */
-#include <stdlib.h>
-#include <time.h>
-#include <io.h>
-#define RAND
-#undef _DES_PROTO
-#define _DES_PROTO
-#endif
-
-#if defined(__STDC__) || defined(VMS) || defined(M_XENIX) || defined(MSDOS)
-#include <string.h>
-#endif
-
-#ifndef RAND
-#define RAND
-#endif
-
-#ifdef MSDOS
-#define getpid() 2
-extern int errno;
-#define RAND
-#undef _DES_PROTO
-#define _DES_PROTO
-#endif
-
-#if defined(NOCONST)
-#define const
-#endif
-
-#ifdef __STDC__
-#undef _DES_PROTO
-#define _DES_PROTO
-#endif
-
-#ifdef RAND
-#define srandom(s) srand(s)
-#define random rand
-#endif
-
-#define ITERATIONS 16
-#define HALF_ITERATIONS 8
-
-/* used in des_read and des_write */
-#define MAXWRITE (1024*16)
-#define BSIZE (MAXWRITE+4)
-
-#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
- l|=((unsigned long)(*((c)++)))<< 8L, \
- l|=((unsigned long)(*((c)++)))<<16L, \
- l|=((unsigned long)(*((c)++)))<<24L)
-
-/* NOTE - c is not incremented as per c2l */
-#define c2ln(c,l1,l2,n) { \
- c+=n; \
- l1=l2=0; \
- switch (n) { \
- case 8: l2 =((unsigned long)(*(--(c))))<<24L; \
- case 7: l2|=((unsigned long)(*(--(c))))<<16L; \
- case 6: l2|=((unsigned long)(*(--(c))))<< 8L; \
- case 5: l2|=((unsigned long)(*(--(c)))); \
- case 4: l1 =((unsigned long)(*(--(c))))<<24L; \
- case 3: l1|=((unsigned long)(*(--(c))))<<16L; \
- case 2: l1|=((unsigned long)(*(--(c))))<< 8L; \
- case 1: l1|=((unsigned long)(*(--(c)))); \
- } \
- }
-
-#define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
- *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
- *((c)++)=(unsigned char)(((l)>>16L)&0xff), \
- *((c)++)=(unsigned char)(((l)>>24L)&0xff))
-
-/* replacements for htonl and ntohl since I have no idea what to do
- * when faced with machines with 8 byte longs. */
-#define HDRSIZE 4
-
-#define n2l(c,l) (l =((unsigned long)(*((c)++)))<<24L, \
- l|=((unsigned long)(*((c)++)))<<16L, \
- l|=((unsigned long)(*((c)++)))<< 8L, \
- l|=((unsigned long)(*((c)++))))
-
-#define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24L)&0xff), \
- *((c)++)=(unsigned char)(((l)>>16L)&0xff), \
- *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
- *((c)++)=(unsigned char)(((l) )&0xff))
-
-/* NOTE - c is not incremented as per l2c */
-#define l2cn(l1,l2,c,n) { \
- c+=n; \
- switch (n) { \
- case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); \
- case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); \
- case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); \
- case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \
- case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); \
- case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); \
- case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); \
- case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \
- } \
- }
-
-/* The changes to this macro may help or hinder, depending on the
- * compiler and the achitecture. gcc2 always seems to do well :-).
- * Inspired by Dana How <how@isl.stanford.edu>
- * DO NOT use the alternative version on machines with 8 byte longs. */
-#ifdef DES_USR_PTR
-#define D_ENCRYPT(L,R,S) { \
- u=((R^s[S ])<<2); \
- t= R^s[S+1]; \
- t=((t>>2)+(t<<30)); \
- L^= \
- *(unsigned long *)(des_SP+0x0100+((t )&0xfc))+ \
- *(unsigned long *)(des_SP+0x0300+((t>> 8)&0xfc))+ \
- *(unsigned long *)(des_SP+0x0500+((t>>16)&0xfc))+ \
- *(unsigned long *)(des_SP+0x0700+((t>>24)&0xfc))+ \
- *(unsigned long *)(des_SP+ ((u )&0xfc))+ \
- *(unsigned long *)(des_SP+0x0200+((u>> 8)&0xfc))+ \
- *(unsigned long *)(des_SP+0x0400+((u>>16)&0xfc))+ \
- *(unsigned long *)(des_SP+0x0600+((u>>24)&0xfc)); }
-#else /* original version */
-#ifdef MSDOS
-#define D_ENCRYPT(L,R,S) \
- U.l=R^s[S+1]; \
- T.s[0]=((U.s[0]>>4)|(U.s[1]<<12))&0x3f3f; \
- T.s[1]=((U.s[1]>>4)|(U.s[0]<<12))&0x3f3f; \
- U.l=(R^s[S ])&0x3f3f3f3fL; \
- L^= des_SPtrans[1][(T.c[0])]| \
- des_SPtrans[3][(T.c[1])]| \
- des_SPtrans[5][(T.c[2])]| \
- des_SPtrans[7][(T.c[3])]| \
- des_SPtrans[0][(U.c[0])]| \
- des_SPtrans[2][(U.c[1])]| \
- des_SPtrans[4][(U.c[2])]| \
- des_SPtrans[6][(U.c[3])];
-#else
-#define D_ENCRYPT(Q,R,S) {\
- u=(R^s[S ]); \
- t=R^s[S+1]; \
- t=((t>>4L)+(t<<28L)); \
- Q^= des_SPtrans[1][(t )&0x3f]| \
- des_SPtrans[3][(t>> 8L)&0x3f]| \
- des_SPtrans[5][(t>>16L)&0x3f]| \
- des_SPtrans[7][(t>>24L)&0x3f]| \
- des_SPtrans[0][(u )&0x3f]| \
- des_SPtrans[2][(u>> 8L)&0x3f]| \
- des_SPtrans[4][(u>>16L)&0x3f]| \
- des_SPtrans[6][(u>>24L)&0x3f]; }
-#endif
-#endif
-
- /* IP and FP
- * The problem is more of a geometric problem that random bit fiddling.
- 0 1 2 3 4 5 6 7 62 54 46 38 30 22 14 6
- 8 9 10 11 12 13 14 15 60 52 44 36 28 20 12 4
- 16 17 18 19 20 21 22 23 58 50 42 34 26 18 10 2
- 24 25 26 27 28 29 30 31 to 56 48 40 32 24 16 8 0
-
- 32 33 34 35 36 37 38 39 63 55 47 39 31 23 15 7
- 40 41 42 43 44 45 46 47 61 53 45 37 29 21 13 5
- 48 49 50 51 52 53 54 55 59 51 43 35 27 19 11 3
- 56 57 58 59 60 61 62 63 57 49 41 33 25 17 9 1
-
- The output has been subject to swaps of the form
- 0 1 -> 3 1 but the odd and even bits have been put into
- 2 3 2 0
- different words. The main trick is to remember that
- t=((l>>size)^r)&(mask);
- r^=t;
- l^=(t<<size);
- can be used to swap and move bits between words.
-
- So l = 0 1 2 3 r = 16 17 18 19
- 4 5 6 7 20 21 22 23
- 8 9 10 11 24 25 26 27
- 12 13 14 15 28 29 30 31
- becomes (for size == 2 and mask == 0x3333)
- t = 2^16 3^17 -- -- l = 0 1 16 17 r = 2 3 18 19
- 6^20 7^21 -- -- 4 5 20 21 6 7 22 23
- 10^24 11^25 -- -- 8 9 24 25 10 11 24 25
- 14^28 15^29 -- -- 12 13 28 29 14 15 28 29
-
- Thanks for hints from Richard Outerbridge - he told me IP&FP
- could be done in 15 xor, 10 shifts and 5 ands.
- When I finally started to think of the problem in 2D
- I first got ~42 operations without xors. When I remembered
- how to use xors :-) I got it to its final state.
- */
-#define PERM_OP(a,b,t,n,m) ((t)=((((a)>>(n))^(b))&(m)),\
- (b)^=(t),\
- (a)^=((t)<<(n)))
-
-#define IP(l,r) \
- { \
- register unsigned long tt; \
- PERM_OP(r,l,tt, 4,0x0f0f0f0fL); \
- PERM_OP(l,r,tt,16,0x0000ffffL); \
- PERM_OP(r,l,tt, 2,0x33333333L); \
- PERM_OP(l,r,tt, 8,0x00ff00ffL); \
- PERM_OP(r,l,tt, 1,0x55555555L); \
- }
-
-#define FP(l,r) \
- { \
- register unsigned long tt; \
- PERM_OP(l,r,tt, 1,0x55555555L); \
- PERM_OP(r,l,tt, 8,0x00ff00ffL); \
- PERM_OP(l,r,tt, 2,0x33333333L); \
- PERM_OP(r,l,tt,16,0x0000ffffL); \
- PERM_OP(l,r,tt, 4,0x0f0f0f0fL); \
- }
-#endif
diff --git a/kerberosIV/des/ecb3_enc.c b/kerberosIV/des/ecb3_enc.c
deleted file mode 100644
index ca0ac176342..00000000000
--- a/kerberosIV/des/ecb3_enc.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* lib/des/ecb3_enc.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-
-void des_ecb3_encrypt(input, output, ks1, ks2, ks3, encrypt)
-des_cblock (*input);
-des_cblock (*output);
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_key_schedule ks3;
-int encrypt;
- {
- register unsigned long l0,l1;
- register unsigned char *in,*out;
- unsigned long ll[2];
-
- in=(unsigned char *)input;
- out=(unsigned char *)output;
- c2l(in,l0);
- c2l(in,l1);
- IP(l0,l1);
- ll[0]=l0;
- ll[1]=l1;
- des_encrypt2(ll,ks1,encrypt);
- des_encrypt2(ll,ks2,!encrypt);
- des_encrypt2(ll,ks3,encrypt);
- l0=ll[0];
- l1=ll[1];
- FP(l1,l0);
- l2c(l0,out);
- l2c(l1,out);
- }
diff --git a/kerberosIV/des/ecb_enc.c b/kerberosIV/des/ecb_enc.c
deleted file mode 100644
index b10ee02997a..00000000000
--- a/kerberosIV/des/ecb_enc.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* lib/des/ecb_enc.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-#include "spr.h"
-
-static const char *DES_version="libdes v 3.21 - 95/11/21 - eay";
-
-void des_ecb_encrypt(input, output, ks, encrypt)
-des_cblock (*input);
-des_cblock (*output);
-des_key_schedule ks;
-int encrypt;
- {
- register unsigned long l0,l1;
- register unsigned char *in,*out;
- unsigned long ll[2];
-
- in=(unsigned char *)input;
- out=(unsigned char *)output;
- c2l(in,l0); ll[0]=l0;
- c2l(in,l1); ll[1]=l1;
- des_encrypt(ll,ks,encrypt);
- l0=ll[0]; l2c(l0,out);
- l1=ll[1]; l2c(l1,out);
- l0=l1=ll[0]=ll[1]=0;
- }
-
-void des_encrypt(data, ks, encrypt)
-unsigned long *data;
-des_key_schedule ks;
-int encrypt;
- {
- register unsigned long l,r,t,u;
-#ifdef DES_USE_PTR
- register unsigned char *des_SP=(unsigned char *)des_SPtrans;
-#endif
-#ifdef MSDOS
- union fudge {
- unsigned long l;
- unsigned short s[2];
- unsigned char c[4];
- } U,T;
-#endif
- register int i;
- register unsigned long *s;
-
- u=data[0];
- r=data[1];
-
- IP(u,r);
- /* Things have been modified so that the initial rotate is
- * done outside the loop. This required the
- * des_SPtrans values in sp.h to be rotated 1 bit to the right.
- * One perl script later and things have a 5% speed up on a sparc2.
- * Thanks to Richard Outerbridge <71755.204@CompuServe.COM>
- * for pointing this out. */
- l=(r<<1)|(r>>31);
- r=(u<<1)|(u>>31);
-
- /* clear the top bits on machines with 8byte longs */
- l&=0xffffffffL;
- r&=0xffffffffL;
-
- s=(unsigned long *)ks;
- /* I don't know if it is worth the effort of loop unrolling the
- * inner loop */
- if (encrypt)
- {
- for (i=0; i<32; i+=4)
- {
- D_ENCRYPT(l,r,i+0); /* 1 */
- D_ENCRYPT(r,l,i+2); /* 2 */
- }
- }
- else
- {
- for (i=30; i>0; i-=4)
- {
- D_ENCRYPT(l,r,i-0); /* 16 */
- D_ENCRYPT(r,l,i-2); /* 15 */
- }
- }
- l=(l>>1)|(l<<31);
- r=(r>>1)|(r<<31);
- /* clear the top bits on machines with 8byte longs */
- l&=0xffffffffL;
- r&=0xffffffffL;
-
- FP(r,l);
- data[0]=l;
- data[1]=r;
- l=r=t=u=0;
- }
-
-void des_encrypt2(data, ks, encrypt)
-unsigned long *data;
-des_key_schedule ks;
-int encrypt;
- {
- register unsigned long l,r,t,u;
-#ifdef DES_USE_PTR
- register unsigned char *des_SP=(unsigned char *)des_SPtrans;
-#endif
-#ifdef MSDOS
- union fudge {
- unsigned long l;
- unsigned short s[2];
- unsigned char c[4];
- } U,T;
-#endif
- register int i;
- register unsigned long *s;
-
- u=data[0];
- r=data[1];
-
- /* Things have been modified so that the initial rotate is
- * done outside the loop. This required the
- * des_SPtrans values in sp.h to be rotated 1 bit to the right.
- * One perl script later and things have a 5% speed up on a sparc2.
- * Thanks to Richard Outerbridge <71755.204@CompuServe.COM>
- * for pointing this out. */
- l=(r<<1)|(r>>31);
- r=(u<<1)|(u>>31);
-
- /* clear the top bits on machines with 8byte longs */
- l&=0xffffffffL;
- r&=0xffffffffL;
-
- s=(unsigned long *)ks;
- /* I don't know if it is worth the effort of loop unrolling the
- * inner loop */
- if (encrypt)
- {
- for (i=0; i<32; i+=4)
- {
- D_ENCRYPT(l,r,i+0); /* 1 */
- D_ENCRYPT(r,l,i+2); /* 2 */
- }
- }
- else
- {
- for (i=30; i>0; i-=4)
- {
- D_ENCRYPT(l,r,i-0); /* 16 */
- D_ENCRYPT(r,l,i-2); /* 15 */
- }
- }
- l=(l>>1)|(l<<31);
- r=(r>>1)|(r<<31);
- /* clear the top bits on machines with 8byte longs */
- l&=0xffffffffL;
- r&=0xffffffffL;
-
- data[0]=l;
- data[1]=r;
- l=r=t=u=0;
- }
diff --git a/kerberosIV/des/ede_enc.c b/kerberosIV/des/ede_enc.c
deleted file mode 100644
index 5084e949478..00000000000
--- a/kerberosIV/des/ede_enc.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/* lib/des/ede_enc.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-
-void des_ede3_cbc_encrypt(input, output, length, ks1, ks2, ks3, ivec, encrypt)
-des_cblock (*input);
-des_cblock (*output);
-long length;
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_key_schedule ks3;
-des_cblock (*ivec);
-int encrypt;
- {
- register unsigned long tin0,tin1;
- register unsigned long tout0,tout1,xor0,xor1;
- register unsigned char *in,*out;
- register long l=length;
- unsigned long tin[2];
- unsigned char *iv;
-
- in=(unsigned char *)input;
- out=(unsigned char *)output;
- iv=(unsigned char *)ivec;
-
- if (encrypt)
- {
- c2l(iv,tout0);
- c2l(iv,tout1);
- for (; l>0; l-=8)
- {
- if (l >= 8)
- {
- c2l(in,tin0);
- c2l(in,tin1);
- }
- else
- c2ln(in,tin0,tin1,l);
- tin0^=tout0;
- tin1^=tout1;
-
- IP(tin0,tin1);
-
- tin[0]=tin0;
- tin[1]=tin1;
- des_encrypt2((unsigned long *)tin,ks1,DES_ENCRYPT);
- des_encrypt2((unsigned long *)tin,ks2,DES_DECRYPT);
- des_encrypt2((unsigned long *)tin,ks3,DES_ENCRYPT);
- tout0=tin[0];
- tout1=tin[1];
-
- FP(tout1,tout0);
-
- l2c(tout0,out);
- l2c(tout1,out);
- }
- iv=(unsigned char *)ivec;
- l2c(tout0,iv);
- l2c(tout1,iv);
- }
- else
- {
- c2l(iv,xor0);
- c2l(iv,xor1);
- for (; l>0; l-=8)
- {
- register unsigned long t0,t1;
-
- c2l(in,tin0);
- c2l(in,tin1);
-
- t0=tin0;
- t1=tin1;
- IP(tin0,tin1);
-
- tin[0]=tin0;
- tin[1]=tin1;
- des_encrypt2((unsigned long *)tin,ks3,DES_DECRYPT);
- des_encrypt2((unsigned long *)tin,ks2,DES_ENCRYPT);
- des_encrypt2((unsigned long *)tin,ks1,DES_DECRYPT);
- tout0=tin[0];
- tout1=tin[1];
-
- FP(tout1,tout0); /**/
-
- tout0^=xor0;
- tout1^=xor1;
- if (l >= 8)
- {
- l2c(tout0,out);
- l2c(tout1,out);
- }
- else
- l2cn(tout0,tout1,out,l);
- xor0=t0;
- xor1=t1;
- }
- iv=(unsigned char *)ivec;
- l2c(xor0,iv);
- l2c(xor1,iv);
- }
- tin0=tin1=tout0=tout1=xor0=xor1=0;
- tin[0]=tin[1]=0;
- }
-
-#ifdef undef /* MACRO */
-void des_ede2_cbc_encrypt(input, output, length, ks1, ks2, ivec, enc)
-des_cblock (*input);
-des_cblock (*output);
-long length;
-des_key_schedule ks1;
-des_key_schedule ks2;
-des_cblock (*ivec);
-int enc;
- {
- des_ede3_cbc_encrypt(input,output,length,ks1,ks2,ks1,ivec,enc);
- }
-#endif
diff --git a/kerberosIV/des/enc_read.c b/kerberosIV/des/enc_read.c
deleted file mode 100644
index 11a6c5a8254..00000000000
--- a/kerberosIV/des/enc_read.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/* lib/des/enc_read.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include <stdio.h>
-#include <errno.h>
-#include "des_locl.h"
-
-/* This has some uglies in it but it works - even over sockets. */
-extern int errno;
-int des_rw_mode=DES_PCBC_MODE;
-
-int des_enc_read(fd, buf, len, sched, iv)
-int fd;
-char *buf;
-int len;
-des_key_schedule sched;
-des_cblock (*iv);
- {
- /* data to be unencrypted */
- int net_num=0;
- unsigned char net[BSIZE];
- /* extra unencrypted data
- * for when a block of 100 comes in but is des_read one byte at
- * a time. */
- static char unnet[BSIZE];
- static int unnet_start=0;
- static int unnet_left=0;
- int i;
- long num=0,rnum;
- unsigned char *p;
-
- /* left over data from last decrypt */
- if (unnet_left != 0)
- {
- if (unnet_left < len)
- {
- /* we still still need more data but will return
- * with the number of bytes we have - should always
- * check the return value */
- memcpy(buf,&(unnet[unnet_start]),
- (unsigned int)unnet_left);
- /* eay 26/08/92 I had the next 2 lines
- * reversed :-( */
- i=unnet_left;
- unnet_start=unnet_left=0;
- }
- else
- {
- memcpy(buf,&(unnet[unnet_start]),(unsigned int)len);
- unnet_start+=len;
- unnet_left-=len;
- i=len;
- }
- return(i);
- }
-
- /* We need to get more data. */
- if (len > MAXWRITE) len=MAXWRITE;
-
- /* first - get the length */
- net_num=0;
- while (net_num < HDRSIZE)
- {
- i=read(fd,&(net[net_num]),(unsigned int)HDRSIZE-net_num);
- if ((i == -1) && (errno == EINTR)) continue;
- if (i <= 0) return(0);
- net_num+=i;
- }
-
- /* we now have at net_num bytes in net */
- p=net;
- num=0;
- n2l(p,num);
- /* num should be rounded up to the next group of eight
- * we make sure that we have read a multiple of 8 bytes from the net.
- */
- if ((num > MAXWRITE) || (num < 0)) /* error */
- return(-1);
- rnum=(num < 8)?8:((num+7)/8*8);
-
- net_num=0;
- while (net_num < rnum)
- {
- i=read(fd,&(net[net_num]),(unsigned int)rnum-net_num);
- if ((i == -1) && (errno == EINTR)) continue;
- if (i <= 0) return(0);
- net_num+=i;
- }
-
- /* Check if there will be data left over. */
- if (len < num)
- {
- if (des_rw_mode & DES_PCBC_MODE)
- pcbc_encrypt((des_cblock *)net,(des_cblock *)unnet,
- num,sched,iv,DES_DECRYPT);
- else
- cbc_encrypt((des_cblock *)net,(des_cblock *)unnet,
- num,sched,iv,DES_DECRYPT);
- memcpy(buf,unnet,(unsigned int)len);
- unnet_start=len;
- unnet_left=num-len;
-
- /* The following line is done because we return num
- * as the number of bytes read. */
- num=len;
- }
- else
- {
- /* >output is a multiple of 8 byes, if len < rnum
- * >we must be careful. The user must be aware that this
- * >routine will write more bytes than he asked for.
- * >The length of the buffer must be correct.
- * FIXED - Should be ok now 18-9-90 - eay */
- if (len < rnum)
- {
- char tmpbuf[BSIZE];
-
- if (des_rw_mode & DES_PCBC_MODE)
- pcbc_encrypt((des_cblock *)net,
- (des_cblock *)tmpbuf,
- num,sched,iv,DES_DECRYPT);
- else
- cbc_encrypt((des_cblock *)net,
- (des_cblock *)tmpbuf,
- num,sched,iv,DES_DECRYPT);
-
- /* eay 26/08/92 fix a bug that returned more
- * bytes than you asked for (returned len bytes :-( */
- memcpy(buf,tmpbuf,(unsigned int)num);
- }
- else
- {
- if (des_rw_mode & DES_PCBC_MODE)
- pcbc_encrypt((des_cblock *)net,
- (des_cblock *)buf,num,sched,iv,
- DES_DECRYPT);
- else
- cbc_encrypt((des_cblock *)net,
- (des_cblock *)buf,num,sched,iv,
- DES_DECRYPT);
- }
- }
- return(num);
- }
-
diff --git a/kerberosIV/des/enc_writ.c b/kerberosIV/des/enc_writ.c
deleted file mode 100644
index e0d50751f7e..00000000000
--- a/kerberosIV/des/enc_writ.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* lib/des/enc_writ.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include <errno.h>
-#include <time.h>
-#include "des_locl.h"
-
-int des_enc_write(fd, buf, len, sched, iv)
-int fd;
-char *buf;
-int len;
-des_key_schedule sched;
-des_cblock (*iv);
- {
-#ifdef _LIBC
- extern int srandom();
- extern unsigned long time();
- extern int random();
- extern int write();
-#endif
-
- long rnum;
- int i,j,k,outnum;
- char outbuf[BSIZE+HDRSIZE];
- char shortbuf[8];
- char *p;
- static int start=1;
-
- /* If we are sending less than 8 bytes, the same char will look
- * the same if we don't pad it out with random bytes */
- if (start)
- {
- start=0;
- srandom((unsigned int)time(NULL));
- }
-
- /* lets recurse if we want to send the data in small chunks */
- if (len > MAXWRITE)
- {
- j=0;
- for (i=0; i<len; i+=k)
- {
- k=des_enc_write(fd,&(buf[i]),
- ((len-i) > MAXWRITE)?MAXWRITE:(len-i),sched,iv);
- if (k < 0)
- return(k);
- else
- j+=k;
- }
- return(j);
- }
-
- /* write length first */
- p=outbuf;
- l2n(len,p);
-
- /* pad short strings */
- if (len < 8)
- {
- p=shortbuf;
- memcpy(shortbuf,buf,(unsigned int)len);
- for (i=len; i<8; i++)
- shortbuf[i]=random();
- rnum=8;
- }
- else
- {
- p=buf;
- rnum=((len+7)/8*8); /* round up to nearest eight */
- }
-
- if (des_rw_mode & DES_PCBC_MODE)
- pcbc_encrypt((des_cblock *)p,(des_cblock *)&(outbuf[HDRSIZE]),
- (long)((len<8)?8:len),sched,iv,DES_ENCRYPT);
- else
- cbc_encrypt((des_cblock *)p,(des_cblock *)&(outbuf[HDRSIZE]),
- (long)((len<8)?8:len),sched,iv,DES_ENCRYPT);
-
- /* output */
- outnum=rnum+HDRSIZE;
-
- for (j=0; j<outnum; j+=i)
- {
- /* eay 26/08/92 I was not doing writing from where we
- * got upto. */
- i=write(fd,&(outbuf[j]),(unsigned int)(outnum-j));
- if (i == -1)
- {
- if (errno == EINTR)
- i=0;
- else /* This is really a bad error - very bad
- * It will stuff-up both ends. */
- return(-1);
- }
- }
-
- return(len);
- }
diff --git a/kerberosIV/des/fcrypt.c b/kerberosIV/des/fcrypt.c
deleted file mode 100644
index d43d0d72853..00000000000
--- a/kerberosIV/des/fcrypt.c
+++ /dev/null
@@ -1,654 +0,0 @@
-/* lib/des/fcrypt.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include <stdio.h>
-
-/* Eric Young.
- * This version of crypt has been developed from my MIT compatable
- * DES library.
- * The library is available at pub/Crypto/DES at ftp.psy.uq.oz.au
- * eay@mincom.oz.au or eay@psych.psy.uq.oz.au
- */
-
-#if !defined(_LIBC) || defined(NOCONST)
-#define const
-#endif
-
-typedef unsigned char des_cblock[8];
-
-typedef struct des_ks_struct
- {
- union {
- des_cblock _;
- /* make sure things are correct size on machines with
- * 8 byte longs */
- unsigned long pad[2];
- } ks;
-#define _ ks._
- } des_key_schedule[16];
-
-#define DES_KEY_SZ (sizeof(des_cblock))
-#define DES_ENCRYPT 1
-#define DES_DECRYPT 0
-
-#define ITERATIONS 16
-#define HALF_ITERATIONS 8
-
-#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
- l|=((unsigned long)(*((c)++)))<< 8, \
- l|=((unsigned long)(*((c)++)))<<16, \
- l|=((unsigned long)(*((c)++)))<<24)
-
-#define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
- *((c)++)=(unsigned char)(((l)>> 8)&0xff), \
- *((c)++)=(unsigned char)(((l)>>16)&0xff), \
- *((c)++)=(unsigned char)(((l)>>24)&0xff))
-
-static const unsigned long SPtrans[8][64]={
-{
-/* nibble 0 */
-0x00820200L, 0x00020000L, 0x80800000L, 0x80820200L,
-0x00800000L, 0x80020200L, 0x80020000L, 0x80800000L,
-0x80020200L, 0x00820200L, 0x00820000L, 0x80000200L,
-0x80800200L, 0x00800000L, 0x00000000L, 0x80020000L,
-0x00020000L, 0x80000000L, 0x00800200L, 0x00020200L,
-0x80820200L, 0x00820000L, 0x80000200L, 0x00800200L,
-0x80000000L, 0x00000200L, 0x00020200L, 0x80820000L,
-0x00000200L, 0x80800200L, 0x80820000L, 0x00000000L,
-0x00000000L, 0x80820200L, 0x00800200L, 0x80020000L,
-0x00820200L, 0x00020000L, 0x80000200L, 0x00800200L,
-0x80820000L, 0x00000200L, 0x00020200L, 0x80800000L,
-0x80020200L, 0x80000000L, 0x80800000L, 0x00820000L,
-0x80820200L, 0x00020200L, 0x00820000L, 0x80800200L,
-0x00800000L, 0x80000200L, 0x80020000L, 0x00000000L,
-0x00020000L, 0x00800000L, 0x80800200L, 0x00820200L,
-0x80000000L, 0x80820000L, 0x00000200L, 0x80020200L,
-},{
-/* nibble 1 */
-0x10042004L, 0x00000000L, 0x00042000L, 0x10040000L,
-0x10000004L, 0x00002004L, 0x10002000L, 0x00042000L,
-0x00002000L, 0x10040004L, 0x00000004L, 0x10002000L,
-0x00040004L, 0x10042000L, 0x10040000L, 0x00000004L,
-0x00040000L, 0x10002004L, 0x10040004L, 0x00002000L,
-0x00042004L, 0x10000000L, 0x00000000L, 0x00040004L,
-0x10002004L, 0x00042004L, 0x10042000L, 0x10000004L,
-0x10000000L, 0x00040000L, 0x00002004L, 0x10042004L,
-0x00040004L, 0x10042000L, 0x10002000L, 0x00042004L,
-0x10042004L, 0x00040004L, 0x10000004L, 0x00000000L,
-0x10000000L, 0x00002004L, 0x00040000L, 0x10040004L,
-0x00002000L, 0x10000000L, 0x00042004L, 0x10002004L,
-0x10042000L, 0x00002000L, 0x00000000L, 0x10000004L,
-0x00000004L, 0x10042004L, 0x00042000L, 0x10040000L,
-0x10040004L, 0x00040000L, 0x00002004L, 0x10002000L,
-0x10002004L, 0x00000004L, 0x10040000L, 0x00042000L,
-},{
-/* nibble 2 */
-0x41000000L, 0x01010040L, 0x00000040L, 0x41000040L,
-0x40010000L, 0x01000000L, 0x41000040L, 0x00010040L,
-0x01000040L, 0x00010000L, 0x01010000L, 0x40000000L,
-0x41010040L, 0x40000040L, 0x40000000L, 0x41010000L,
-0x00000000L, 0x40010000L, 0x01010040L, 0x00000040L,
-0x40000040L, 0x41010040L, 0x00010000L, 0x41000000L,
-0x41010000L, 0x01000040L, 0x40010040L, 0x01010000L,
-0x00010040L, 0x00000000L, 0x01000000L, 0x40010040L,
-0x01010040L, 0x00000040L, 0x40000000L, 0x00010000L,
-0x40000040L, 0x40010000L, 0x01010000L, 0x41000040L,
-0x00000000L, 0x01010040L, 0x00010040L, 0x41010000L,
-0x40010000L, 0x01000000L, 0x41010040L, 0x40000000L,
-0x40010040L, 0x41000000L, 0x01000000L, 0x41010040L,
-0x00010000L, 0x01000040L, 0x41000040L, 0x00010040L,
-0x01000040L, 0x00000000L, 0x41010000L, 0x40000040L,
-0x41000000L, 0x40010040L, 0x00000040L, 0x01010000L,
-},{
-/* nibble 3 */
-0x00100402L, 0x04000400L, 0x00000002L, 0x04100402L,
-0x00000000L, 0x04100000L, 0x04000402L, 0x00100002L,
-0x04100400L, 0x04000002L, 0x04000000L, 0x00000402L,
-0x04000002L, 0x00100402L, 0x00100000L, 0x04000000L,
-0x04100002L, 0x00100400L, 0x00000400L, 0x00000002L,
-0x00100400L, 0x04000402L, 0x04100000L, 0x00000400L,
-0x00000402L, 0x00000000L, 0x00100002L, 0x04100400L,
-0x04000400L, 0x04100002L, 0x04100402L, 0x00100000L,
-0x04100002L, 0x00000402L, 0x00100000L, 0x04000002L,
-0x00100400L, 0x04000400L, 0x00000002L, 0x04100000L,
-0x04000402L, 0x00000000L, 0x00000400L, 0x00100002L,
-0x00000000L, 0x04100002L, 0x04100400L, 0x00000400L,
-0x04000000L, 0x04100402L, 0x00100402L, 0x00100000L,
-0x04100402L, 0x00000002L, 0x04000400L, 0x00100402L,
-0x00100002L, 0x00100400L, 0x04100000L, 0x04000402L,
-0x00000402L, 0x04000000L, 0x04000002L, 0x04100400L,
-},{
-/* nibble 4 */
-0x02000000L, 0x00004000L, 0x00000100L, 0x02004108L,
-0x02004008L, 0x02000100L, 0x00004108L, 0x02004000L,
-0x00004000L, 0x00000008L, 0x02000008L, 0x00004100L,
-0x02000108L, 0x02004008L, 0x02004100L, 0x00000000L,
-0x00004100L, 0x02000000L, 0x00004008L, 0x00000108L,
-0x02000100L, 0x00004108L, 0x00000000L, 0x02000008L,
-0x00000008L, 0x02000108L, 0x02004108L, 0x00004008L,
-0x02004000L, 0x00000100L, 0x00000108L, 0x02004100L,
-0x02004100L, 0x02000108L, 0x00004008L, 0x02004000L,
-0x00004000L, 0x00000008L, 0x02000008L, 0x02000100L,
-0x02000000L, 0x00004100L, 0x02004108L, 0x00000000L,
-0x00004108L, 0x02000000L, 0x00000100L, 0x00004008L,
-0x02000108L, 0x00000100L, 0x00000000L, 0x02004108L,
-0x02004008L, 0x02004100L, 0x00000108L, 0x00004000L,
-0x00004100L, 0x02004008L, 0x02000100L, 0x00000108L,
-0x00000008L, 0x00004108L, 0x02004000L, 0x02000008L,
-},{
-/* nibble 5 */
-0x20000010L, 0x00080010L, 0x00000000L, 0x20080800L,
-0x00080010L, 0x00000800L, 0x20000810L, 0x00080000L,
-0x00000810L, 0x20080810L, 0x00080800L, 0x20000000L,
-0x20000800L, 0x20000010L, 0x20080000L, 0x00080810L,
-0x00080000L, 0x20000810L, 0x20080010L, 0x00000000L,
-0x00000800L, 0x00000010L, 0x20080800L, 0x20080010L,
-0x20080810L, 0x20080000L, 0x20000000L, 0x00000810L,
-0x00000010L, 0x00080800L, 0x00080810L, 0x20000800L,
-0x00000810L, 0x20000000L, 0x20000800L, 0x00080810L,
-0x20080800L, 0x00080010L, 0x00000000L, 0x20000800L,
-0x20000000L, 0x00000800L, 0x20080010L, 0x00080000L,
-0x00080010L, 0x20080810L, 0x00080800L, 0x00000010L,
-0x20080810L, 0x00080800L, 0x00080000L, 0x20000810L,
-0x20000010L, 0x20080000L, 0x00080810L, 0x00000000L,
-0x00000800L, 0x20000010L, 0x20000810L, 0x20080800L,
-0x20080000L, 0x00000810L, 0x00000010L, 0x20080010L,
-},{
-/* nibble 6 */
-0x00001000L, 0x00000080L, 0x00400080L, 0x00400001L,
-0x00401081L, 0x00001001L, 0x00001080L, 0x00000000L,
-0x00400000L, 0x00400081L, 0x00000081L, 0x00401000L,
-0x00000001L, 0x00401080L, 0x00401000L, 0x00000081L,
-0x00400081L, 0x00001000L, 0x00001001L, 0x00401081L,
-0x00000000L, 0x00400080L, 0x00400001L, 0x00001080L,
-0x00401001L, 0x00001081L, 0x00401080L, 0x00000001L,
-0x00001081L, 0x00401001L, 0x00000080L, 0x00400000L,
-0x00001081L, 0x00401000L, 0x00401001L, 0x00000081L,
-0x00001000L, 0x00000080L, 0x00400000L, 0x00401001L,
-0x00400081L, 0x00001081L, 0x00001080L, 0x00000000L,
-0x00000080L, 0x00400001L, 0x00000001L, 0x00400080L,
-0x00000000L, 0x00400081L, 0x00400080L, 0x00001080L,
-0x00000081L, 0x00001000L, 0x00401081L, 0x00400000L,
-0x00401080L, 0x00000001L, 0x00001001L, 0x00401081L,
-0x00400001L, 0x00401080L, 0x00401000L, 0x00001001L,
-},{
-/* nibble 7 */
-0x08200020L, 0x08208000L, 0x00008020L, 0x00000000L,
-0x08008000L, 0x00200020L, 0x08200000L, 0x08208020L,
-0x00000020L, 0x08000000L, 0x00208000L, 0x00008020L,
-0x00208020L, 0x08008020L, 0x08000020L, 0x08200000L,
-0x00008000L, 0x00208020L, 0x00200020L, 0x08008000L,
-0x08208020L, 0x08000020L, 0x00000000L, 0x00208000L,
-0x08000000L, 0x00200000L, 0x08008020L, 0x08200020L,
-0x00200000L, 0x00008000L, 0x08208000L, 0x00000020L,
-0x00200000L, 0x00008000L, 0x08000020L, 0x08208020L,
-0x00008020L, 0x08000000L, 0x00000000L, 0x00208000L,
-0x08200020L, 0x08008020L, 0x08008000L, 0x00200020L,
-0x08208000L, 0x00000020L, 0x00200020L, 0x08008000L,
-0x08208020L, 0x00200000L, 0x08200000L, 0x08000020L,
-0x00208000L, 0x00008020L, 0x08008020L, 0x08200000L,
-0x00000020L, 0x08208000L, 0x00208020L, 0x00000000L,
-0x08000000L, 0x08200020L, 0x00008000L, 0x00208020L}};
-static const unsigned long skb[8][64]={
-{
-/* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
-0x00000000L,0x00000010L,0x20000000L,0x20000010L,
-0x00010000L,0x00010010L,0x20010000L,0x20010010L,
-0x00000800L,0x00000810L,0x20000800L,0x20000810L,
-0x00010800L,0x00010810L,0x20010800L,0x20010810L,
-0x00000020L,0x00000030L,0x20000020L,0x20000030L,
-0x00010020L,0x00010030L,0x20010020L,0x20010030L,
-0x00000820L,0x00000830L,0x20000820L,0x20000830L,
-0x00010820L,0x00010830L,0x20010820L,0x20010830L,
-0x00080000L,0x00080010L,0x20080000L,0x20080010L,
-0x00090000L,0x00090010L,0x20090000L,0x20090010L,
-0x00080800L,0x00080810L,0x20080800L,0x20080810L,
-0x00090800L,0x00090810L,0x20090800L,0x20090810L,
-0x00080020L,0x00080030L,0x20080020L,0x20080030L,
-0x00090020L,0x00090030L,0x20090020L,0x20090030L,
-0x00080820L,0x00080830L,0x20080820L,0x20080830L,
-0x00090820L,0x00090830L,0x20090820L,0x20090830L,
-},{
-/* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */
-0x00000000L,0x02000000L,0x00002000L,0x02002000L,
-0x00200000L,0x02200000L,0x00202000L,0x02202000L,
-0x00000004L,0x02000004L,0x00002004L,0x02002004L,
-0x00200004L,0x02200004L,0x00202004L,0x02202004L,
-0x00000400L,0x02000400L,0x00002400L,0x02002400L,
-0x00200400L,0x02200400L,0x00202400L,0x02202400L,
-0x00000404L,0x02000404L,0x00002404L,0x02002404L,
-0x00200404L,0x02200404L,0x00202404L,0x02202404L,
-0x10000000L,0x12000000L,0x10002000L,0x12002000L,
-0x10200000L,0x12200000L,0x10202000L,0x12202000L,
-0x10000004L,0x12000004L,0x10002004L,0x12002004L,
-0x10200004L,0x12200004L,0x10202004L,0x12202004L,
-0x10000400L,0x12000400L,0x10002400L,0x12002400L,
-0x10200400L,0x12200400L,0x10202400L,0x12202400L,
-0x10000404L,0x12000404L,0x10002404L,0x12002404L,
-0x10200404L,0x12200404L,0x10202404L,0x12202404L,
-},{
-/* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */
-0x00000000L,0x00000001L,0x00040000L,0x00040001L,
-0x01000000L,0x01000001L,0x01040000L,0x01040001L,
-0x00000002L,0x00000003L,0x00040002L,0x00040003L,
-0x01000002L,0x01000003L,0x01040002L,0x01040003L,
-0x00000200L,0x00000201L,0x00040200L,0x00040201L,
-0x01000200L,0x01000201L,0x01040200L,0x01040201L,
-0x00000202L,0x00000203L,0x00040202L,0x00040203L,
-0x01000202L,0x01000203L,0x01040202L,0x01040203L,
-0x08000000L,0x08000001L,0x08040000L,0x08040001L,
-0x09000000L,0x09000001L,0x09040000L,0x09040001L,
-0x08000002L,0x08000003L,0x08040002L,0x08040003L,
-0x09000002L,0x09000003L,0x09040002L,0x09040003L,
-0x08000200L,0x08000201L,0x08040200L,0x08040201L,
-0x09000200L,0x09000201L,0x09040200L,0x09040201L,
-0x08000202L,0x08000203L,0x08040202L,0x08040203L,
-0x09000202L,0x09000203L,0x09040202L,0x09040203L,
-},{
-/* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */
-0x00000000L,0x00100000L,0x00000100L,0x00100100L,
-0x00000008L,0x00100008L,0x00000108L,0x00100108L,
-0x00001000L,0x00101000L,0x00001100L,0x00101100L,
-0x00001008L,0x00101008L,0x00001108L,0x00101108L,
-0x04000000L,0x04100000L,0x04000100L,0x04100100L,
-0x04000008L,0x04100008L,0x04000108L,0x04100108L,
-0x04001000L,0x04101000L,0x04001100L,0x04101100L,
-0x04001008L,0x04101008L,0x04001108L,0x04101108L,
-0x00020000L,0x00120000L,0x00020100L,0x00120100L,
-0x00020008L,0x00120008L,0x00020108L,0x00120108L,
-0x00021000L,0x00121000L,0x00021100L,0x00121100L,
-0x00021008L,0x00121008L,0x00021108L,0x00121108L,
-0x04020000L,0x04120000L,0x04020100L,0x04120100L,
-0x04020008L,0x04120008L,0x04020108L,0x04120108L,
-0x04021000L,0x04121000L,0x04021100L,0x04121100L,
-0x04021008L,0x04121008L,0x04021108L,0x04121108L,
-},{
-/* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
-0x00000000L,0x10000000L,0x00010000L,0x10010000L,
-0x00000004L,0x10000004L,0x00010004L,0x10010004L,
-0x20000000L,0x30000000L,0x20010000L,0x30010000L,
-0x20000004L,0x30000004L,0x20010004L,0x30010004L,
-0x00100000L,0x10100000L,0x00110000L,0x10110000L,
-0x00100004L,0x10100004L,0x00110004L,0x10110004L,
-0x20100000L,0x30100000L,0x20110000L,0x30110000L,
-0x20100004L,0x30100004L,0x20110004L,0x30110004L,
-0x00001000L,0x10001000L,0x00011000L,0x10011000L,
-0x00001004L,0x10001004L,0x00011004L,0x10011004L,
-0x20001000L,0x30001000L,0x20011000L,0x30011000L,
-0x20001004L,0x30001004L,0x20011004L,0x30011004L,
-0x00101000L,0x10101000L,0x00111000L,0x10111000L,
-0x00101004L,0x10101004L,0x00111004L,0x10111004L,
-0x20101000L,0x30101000L,0x20111000L,0x30111000L,
-0x20101004L,0x30101004L,0x20111004L,0x30111004L,
-},{
-/* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */
-0x00000000L,0x08000000L,0x00000008L,0x08000008L,
-0x00000400L,0x08000400L,0x00000408L,0x08000408L,
-0x00020000L,0x08020000L,0x00020008L,0x08020008L,
-0x00020400L,0x08020400L,0x00020408L,0x08020408L,
-0x00000001L,0x08000001L,0x00000009L,0x08000009L,
-0x00000401L,0x08000401L,0x00000409L,0x08000409L,
-0x00020001L,0x08020001L,0x00020009L,0x08020009L,
-0x00020401L,0x08020401L,0x00020409L,0x08020409L,
-0x02000000L,0x0A000000L,0x02000008L,0x0A000008L,
-0x02000400L,0x0A000400L,0x02000408L,0x0A000408L,
-0x02020000L,0x0A020000L,0x02020008L,0x0A020008L,
-0x02020400L,0x0A020400L,0x02020408L,0x0A020408L,
-0x02000001L,0x0A000001L,0x02000009L,0x0A000009L,
-0x02000401L,0x0A000401L,0x02000409L,0x0A000409L,
-0x02020001L,0x0A020001L,0x02020009L,0x0A020009L,
-0x02020401L,0x0A020401L,0x02020409L,0x0A020409L,
-},{
-/* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */
-0x00000000L,0x00000100L,0x00080000L,0x00080100L,
-0x01000000L,0x01000100L,0x01080000L,0x01080100L,
-0x00000010L,0x00000110L,0x00080010L,0x00080110L,
-0x01000010L,0x01000110L,0x01080010L,0x01080110L,
-0x00200000L,0x00200100L,0x00280000L,0x00280100L,
-0x01200000L,0x01200100L,0x01280000L,0x01280100L,
-0x00200010L,0x00200110L,0x00280010L,0x00280110L,
-0x01200010L,0x01200110L,0x01280010L,0x01280110L,
-0x00000200L,0x00000300L,0x00080200L,0x00080300L,
-0x01000200L,0x01000300L,0x01080200L,0x01080300L,
-0x00000210L,0x00000310L,0x00080210L,0x00080310L,
-0x01000210L,0x01000310L,0x01080210L,0x01080310L,
-0x00200200L,0x00200300L,0x00280200L,0x00280300L,
-0x01200200L,0x01200300L,0x01280200L,0x01280300L,
-0x00200210L,0x00200310L,0x00280210L,0x00280310L,
-0x01200210L,0x01200310L,0x01280210L,0x01280310L,
-},{
-/* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */
-0x00000000L,0x04000000L,0x00040000L,0x04040000L,
-0x00000002L,0x04000002L,0x00040002L,0x04040002L,
-0x00002000L,0x04002000L,0x00042000L,0x04042000L,
-0x00002002L,0x04002002L,0x00042002L,0x04042002L,
-0x00000020L,0x04000020L,0x00040020L,0x04040020L,
-0x00000022L,0x04000022L,0x00040022L,0x04040022L,
-0x00002020L,0x04002020L,0x00042020L,0x04042020L,
-0x00002022L,0x04002022L,0x00042022L,0x04042022L,
-0x00000800L,0x04000800L,0x00040800L,0x04040800L,
-0x00000802L,0x04000802L,0x00040802L,0x04040802L,
-0x00002800L,0x04002800L,0x00042800L,0x04042800L,
-0x00002802L,0x04002802L,0x00042802L,0x04042802L,
-0x00000820L,0x04000820L,0x00040820L,0x04040820L,
-0x00000822L,0x04000822L,0x00040822L,0x04040822L,
-0x00002820L,0x04002820L,0x00042820L,0x04042820L,
-0x00002822L,0x04002822L,0x00042822L,0x04042822L,
-} };
-
-/* See ecb_encrypt.c for a pseudo description of these macros. */
-#define PERM_OP(a,b,t,n,m) ((t)=((((a)>>(n))^(b))&(m)),\
- (b)^=(t),\
- (a)^=((t)<<(n)))
-
-#define HPERM_OP(a,t,n,m) ((t)=((((a)<<(16-(n)))^(a))&(m)),\
- (a)=(a)^(t)^(t>>(16-(n))))\
-
-static const int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0};
-
-#ifdef _DES_PROTO
-static int body(unsigned long *out0, unsigned long *out1,
- des_key_schedule ks, unsigned long Eswap0, unsigned long Eswap1);
-static int des_set_key(des_cblock (*key), des_key_schedule schedule);
-#else
-static int body();
-static int des_set_key();
-#endif
-
-static int des_set_key(key, schedule)
-des_cblock (*key);
-des_key_schedule schedule;
- {
- register unsigned long c,d,t,s;
- register unsigned char *in;
- register unsigned long *k;
- register int i;
-
- k=(unsigned long *)schedule;
- in=(unsigned char *)key;
-
- c2l(in,c);
- c2l(in,d);
-
- /* I now do it in 47 simple operations :-)
- * Thanks to John Fletcher (john_fletcher@lccmail.ocf.llnl.gov)
- * for the inspiration. :-) */
- PERM_OP (d,c,t,4,0x0f0f0f0fL);
- HPERM_OP(c,t,-2,0xcccc0000L);
- HPERM_OP(d,t,-2,0xcccc0000L);
- PERM_OP (d,c,t,1,0x55555555L);
- PERM_OP (c,d,t,8,0x00ff00ffL);
- PERM_OP (d,c,t,1,0x55555555L);
- d= (((d&0x000000ffL)<<16)| (d&0x0000ff00L) |
- ((d&0x00ff0000L)>>16)|((c&0xf0000000L)>>4));
- c&=0x0fffffffL;
-
- for (i=0; i<ITERATIONS; i++)
- {
- if (shifts2[i])
- { c=((c>>2)|(c<<26)); d=((d>>2)|(d<<26)); }
- else
- { c=((c>>1)|(c<<27)); d=((d>>1)|(d<<27)); }
- c&=0x0fffffffL;
- d&=0x0fffffffL;
- /* could be a few less shifts but I am to lazy at this
- * point in time to investigate */
- s= skb[0][ (c )&0x3f ]|
- skb[1][((c>> 6L)&0x03)|((c>> 7L)&0x3c)]|
- skb[2][((c>>13L)&0x0f)|((c>>14L)&0x30)]|
- skb[3][((c>>20L)&0x01)|((c>>21L)&0x06) |
- ((c>>22L)&0x38)];
- t= skb[4][ (d )&0x3f ]|
- skb[5][((d>> 7L)&0x03)|((d>> 8L)&0x3c)]|
- skb[6][ (d>>15L)&0x3f ]|
- skb[7][((d>>21L)&0x0f)|((d>>22L)&0x30)];
-
- /* table contained 0213 4657 */
- *(k++)=((t<<16)|(s&0x0000ffffL))&0xffffffffL;
- s= ((s>>16)|(t&0xffff0000L));
-
- s=(s<<4)|(s>>28);
- *(k++)=s&0xffffffffL;
- }
- return(0);
- }
-
-/******************************************************************
- * modified stuff for crypt.
- ******************************************************************/
-
-/* The changes to this macro may help or hinder, depending on the
- * compiler and the achitecture. gcc2 always seems to do well :-).
- * Inspired by Dana How <how@isl.stanford.edu>
- * DO NOT use the alternative version on machines with 8 byte longs.
- */
-#ifdef DES_USE_PTR
-#define D_ENCRYPT(L,R,S) \
- t=(R^(R>>16)); \
- u=(t&E0); \
- t=(t&E1); \
- u=((u^(u<<16))^R^s[S ])<<2; \
- t=(t^(t<<16))^R^s[S+1]; \
- t=(t>>2)|(t<<30); \
- L^= \
- *(unsigned long *)(des_SP+0x0100+((t )&0xfc))+ \
- *(unsigned long *)(des_SP+0x0300+((t>> 8)&0xfc))+ \
- *(unsigned long *)(des_SP+0x0500+((t>>16)&0xfc))+ \
- *(unsigned long *)(des_SP+0x0700+((t>>24)&0xfc))+ \
- *(unsigned long *)(des_SP+ ((u )&0xfc))+ \
- *(unsigned long *)(des_SP+0x0200+((u>> 8)&0xfc))+ \
- *(unsigned long *)(des_SP+0x0400+((u>>16)&0xfc))+ \
- *(unsigned long *)(des_SP+0x0600+((u>>24)&0xfc));
-#else /* original version */
-#define D_ENCRYPT(L,R,S) \
- t=(R^(R>>16)); \
- u=(t&E0); \
- t=(t&E1); \
- u=(u^(u<<16))^R^s[S ]; \
- t=(t^(t<<16))^R^s[S+1]; \
- t=(t>>4)|(t<<28); \
- L^= SPtrans[1][(t )&0x3f]| \
- SPtrans[3][(t>> 8)&0x3f]| \
- SPtrans[5][(t>>16)&0x3f]| \
- SPtrans[7][(t>>24)&0x3f]| \
- SPtrans[0][(u )&0x3f]| \
- SPtrans[2][(u>> 8)&0x3f]| \
- SPtrans[4][(u>>16)&0x3f]| \
- SPtrans[6][(u>>24)&0x3f];
-#endif
-
-static unsigned const char con_salt[128]={
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
-0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,
-0x0A,0x0B,0x05,0x06,0x07,0x08,0x09,0x0A,
-0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,
-0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,
-0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,
-0x23,0x24,0x25,0x20,0x21,0x22,0x23,0x24,
-0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,
-0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,
-0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,
-0x3D,0x3E,0x3F,0x00,0x00,0x00,0x00,0x00,
-};
-
-static unsigned const char cov_2char[64]={
-0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,
-0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,
-0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,
-0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54,
-0x55,0x56,0x57,0x58,0x59,0x5A,0x61,0x62,
-0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,
-0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,
-0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A
-};
-
-#ifdef _DES_PROTO
-char *des_crypt(char *buf,char *salt);
-#else
-char *des_crypt();
-#endif
-
-char *des_crypt(buf,salt)
-char *buf;
-char *salt;
- {
- unsigned int i,j,x,y;
- unsigned long Eswap0=0,Eswap1=0;
- unsigned long out[2],ll;
- des_cblock key;
- des_key_schedule ks;
- static unsigned char buff[20];
- unsigned char bb[9];
- unsigned char *b=bb;
- unsigned char c,u;
-
- /* eay 25/08/92
- * If you call des_crypt("pwd","*") as often happens when you
- * have * as the pwd field in /etc/passwd, the function
- * returns *\0XXXXXXXXX
- * The \0 makes the string look like * so the pwd "*" would
- * crypt to "*". This was found when replacing the crypt in
- * our shared libraries. People found that the disbled
- * accounts effectivly had no passwd :-(. */
- x=buff[0]=((salt[0] == '\0')?'A':salt[0]);
- Eswap0=con_salt[x];
- x=buff[1]=((salt[1] == '\0')?'A':salt[1]);
- Eswap1=con_salt[x]<<4;
-
- for (i=0; i<8; i++)
- {
- c= *(buf++);
- if (!c) break;
- key[i]=(c<<1);
- }
- for (; i<8; i++)
- key[i]=0;
-
- des_set_key((des_cblock *)(key),ks);
- body(&(out[0]),&(out[1]),ks,Eswap0,Eswap1);
-
- ll=out[0]; l2c(ll,b);
- ll=out[1]; l2c(ll,b);
- y=0;
- u=0x80;
- bb[8]=0;
- for (i=2; i<13; i++)
- {
- c=0;
- for (j=0; j<6; j++)
- {
- c<<=1;
- if (bb[y] & u) c|=1;
- u>>=1;
- if (!u)
- {
- y++;
- u=0x80;
- }
- }
- buff[i]=cov_2char[c];
- }
- buff[13]='\0';
- return((char *)buff);
- }
-
-static int body(out0, out1, ks, Eswap0, Eswap1)
-unsigned long *out0;
-unsigned long *out1;
-des_key_schedule ks;
-unsigned long Eswap0;
-unsigned long Eswap1;
- {
- register unsigned long l,r,t,u;
-#ifdef DES_USE_PTR
- register unsigned char *des_SP=(unsigned char *)SPtrans;
-#endif
- register unsigned long *s;
- register int i,j;
- register unsigned long E0,E1;
-
- l=0;
- r=0;
-
- s=(unsigned long *)ks;
- E0=Eswap0;
- E1=Eswap1;
-
- for (j=0; j<25; j++)
- {
- for (i=0; i<(ITERATIONS*2); i+=4)
- {
- D_ENCRYPT(l,r, i); /* 1 */
- D_ENCRYPT(r,l, i+2); /* 2 */
- }
- t=l;
- l=r;
- r=t;
- }
- t=r;
- r=(l>>1L)|(l<<31L);
- l=(t>>1L)|(t<<31L);
- /* clear the top bits on machines with 8byte longs */
- l&=0xffffffffL;
- r&=0xffffffffL;
-
- PERM_OP(r,l,t, 1,0x55555555L);
- PERM_OP(l,r,t, 8,0x00ff00ffL);
- PERM_OP(r,l,t, 2,0x33333333L);
- PERM_OP(l,r,t,16,0x0000ffffL);
- PERM_OP(r,l,t, 4,0x0f0f0f0fL);
-
- *out0=l;
- *out1=r;
- return(0);
- }
-
diff --git a/kerberosIV/des/ncbc_enc.c b/kerberosIV/des/ncbc_enc.c
deleted file mode 100644
index d307ae407a8..00000000000
--- a/kerberosIV/des/ncbc_enc.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* lib/des/ncbc_enc.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-
-void des_ncbc_encrypt(input, output, length, schedule, ivec, encrypt)
-des_cblock (*input);
-des_cblock (*output);
-long length;
-des_key_schedule schedule;
-des_cblock (*ivec);
-int encrypt;
- {
- register unsigned long tin0,tin1;
- register unsigned long tout0,tout1,xor0,xor1;
- register unsigned char *in,*out;
- register long l=length;
- unsigned long tin[2];
- unsigned char *iv;
-
- in=(unsigned char *)input;
- out=(unsigned char *)output;
- iv=(unsigned char *)ivec;
-
- if (encrypt)
- {
- c2l(iv,tout0);
- c2l(iv,tout1);
- for (; l>0; l-=8)
- {
- if (l >= 8)
- {
- c2l(in,tin0);
- c2l(in,tin1);
- }
- else
- c2ln(in,tin0,tin1,l);
- tin0^=tout0; tin[0]=tin0;
- tin1^=tout1; tin[1]=tin1;
- des_encrypt((unsigned long *)tin,schedule,DES_ENCRYPT);
- tout0=tin[0]; l2c(tout0,out);
- tout1=tin[1]; l2c(tout1,out);
- }
- iv=(unsigned char *)ivec;
- l2c(tout0,iv);
- l2c(tout1,iv);
- }
- else
- {
- c2l(iv,xor0);
- c2l(iv,xor1);
- for (; l>0; l-=8)
- {
- c2l(in,tin0); tin[0]=tin0;
- c2l(in,tin1); tin[1]=tin1;
- des_encrypt((unsigned long *)tin,schedule,DES_DECRYPT);
- tout0=tin[0]^xor0;
- tout1=tin[1]^xor1;
- if (l >= 8)
- {
- l2c(tout0,out);
- l2c(tout1,out);
- }
- else
- l2cn(tout0,tout1,out,l);
- xor0=tin0;
- xor1=tin1;
- }
- iv=(unsigned char *)ivec;
- l2c(xor0,iv);
- l2c(xor1,iv);
- }
- tin0=tin1=tout0=tout1=xor0=xor1=0;
- tin[0]=tin[1]=0;
- }
-
diff --git a/kerberosIV/des/ofb64ede.c b/kerberosIV/des/ofb64ede.c
deleted file mode 100644
index 0ac93805054..00000000000
--- a/kerberosIV/des/ofb64ede.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/* lib/des/ofb64enc.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-
-/* The input and output encrypted as though 64bit ofb mode is being
- * used. The extra state information to record how much of the
- * 64bit block we have used is contained in *num;
- */
-void des_ede3_ofb64_encrypt(in, out, length, k1,k2,k3, ivec, num)
-register unsigned char *in;
-register unsigned char *out;
-long length;
-des_key_schedule k1,k2,k3;
-des_cblock (*ivec);
-int *num;
- {
- register unsigned long v0,v1;
- register int n=*num;
- register long l=length;
- des_cblock d;
- register char *dp;
- unsigned long ti[2];
- unsigned char *iv;
- int save=0;
-
- iv=(unsigned char *)ivec;
- c2l(iv,v0);
- c2l(iv,v1);
- ti[0]=v0;
- ti[1]=v1;
- dp=(char *)d;
- l2c(v0,dp);
- l2c(v1,dp);
- while (l--)
- {
- if (n == 0)
- {
- IP(v0,v1);
-
- ti[0]=v0;
- ti[1]=v1;
- des_encrypt2((unsigned long *)ti,k1,DES_ENCRYPT);
- des_encrypt2((unsigned long *)ti,k2,DES_DECRYPT);
- des_encrypt2((unsigned long *)ti,k3,DES_ENCRYPT);
- v0=ti[0];
- v1=ti[1];
-
- FP(v1,v0);
-
- dp=(char *)d;
- l2c(v0,dp);
- l2c(v1,dp);
- save++;
- }
- *(out++)=*(in++)^d[n];
- n=(n+1)&0x07;
- }
- if (save)
- {
-/* v0=ti[0];
- v1=ti[1];*/
- iv=(unsigned char *)ivec;
- l2c(v0,iv);
- l2c(v1,iv);
- }
- v0=v1=ti[0]=ti[1]=0;
- *num=n;
- }
-
-#ifdef undef /* MACRO */
-void des_ede2_ofb64_encrypt(in, out, length, k1,k2, ivec, num)
-register unsigned char *in;
-register unsigned char *out;
-long length;
-des_key_schedule k1,k2;
-des_cblock (*ivec);
-int *num;
- {
- des_ede3_ofb64_encrypt(in, out, length, k1,k2,k1, ivec, num);
- }
-#endif
diff --git a/kerberosIV/des/ofb64enc.c b/kerberosIV/des/ofb64enc.c
deleted file mode 100644
index bc8dd8c8271..00000000000
--- a/kerberosIV/des/ofb64enc.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* lib/des/ofb64enc.c */
-/* Copyright (C) 1995 Eric Young (eay@mincom.oz.au)
- * All rights reserved.
- *
- * This file is part of an SSL implementation written
- * by Eric Young (eay@mincom.oz.au).
- * The implementation was written so as to conform with Netscapes SSL
- * specification. This library and applications are
- * FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- * as long as the following conditions are aheared to.
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed. If this code is used in a product,
- * Eric Young should be given attribution as the author of the parts used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Eric Young (eay@mincom.oz.au)
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include "des_locl.h"
-
-/* The input and output encrypted as though 64bit ofb mode is being
- * used. The extra state information to record how much of the
- * 64bit block we have used is contained in *num;
- */
-void des_ofb64_encrypt(in, out, length, schedule, ivec, num)
-register unsigned char *in;
-register unsigned char *out;
-long length;
-des_key_schedule schedule;
-des_cblock (*ivec);
-int *num;
- {
- register unsigned long v0,v1,t;
- register int n=*num;
- register long l=length;
- des_cblock d;
- register char *dp;
- unsigned long ti[2];
- unsigned char *iv;
- int save=0;
-
- iv=(unsigned char *)ivec;
- c2l(iv,v0);
- c2l(iv,v1);
- ti[0]=v0;
- ti[1]=v1;
- dp=(char *)d;
- l2c(v0,dp);
- l2c(v1,dp);
- while (l--)
- {
- if (n == 0)
- {
- des_encrypt((unsigned long *)ti,schedule,DES_ENCRYPT);
- dp=(char *)d;
- t=ti[0]; l2c(t,dp);
- t=ti[1]; l2c(t,dp);
- save++;
- }
- *(out++)=*(in++)^d[n];
- n=(n+1)&0x07;
- }
- if (save)
- {
- v0=ti[0];
- v1=ti[1];
- iv=(unsigned char *)ivec;
- l2c(v0,iv);
- l2c(v1,iv);
- }
- t=v0=v1=ti[0]=ti[1]=0;
- *num=n;
- }
-