#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 2)."
# Contents:  Makefile README S2o cert.c cert.data crypt.c crypt.s300.S
#   crypt.sparc.S crypt.sun3.S patchlevel.h speeds.c ufc-crypt.h ufc.c
# Wrapped by glad@olivia on Fri Jan 31 10:49:53 1992
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(2560 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X#
X# UFC-crypt: ultra fast crypt(3) implementation
X# Copyright (C) 1991, 1992, Michael Glad, email: glad@daimi.aau.dk
X#
X# This library is free software; you can redistribute it and/or
X# modify it under the terms of the GNU Library General Public
X# License as published by the Free Software Foundation; either
X# version 2 of the License, or (at your option) any later version.
X#
X# This library is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X# Library General Public License for more details.
X#
X# You should have received a copy of the GNU Library General Public
X# License along with this library; if not, write to the Free
X# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X#
X# @(#)Makefile	2.12 1/23/92
X#
X
X#
X# Select one of the following modules:
X#
XCRYPT = crypt.o
X
X# portable C version:  crypt.o
X# SUN3 models:         crypt.sun3.o
X# HP series 300/400:   crypt.s300.o
X# SUN SPARC systems:   crypt.sparc.o
X
X#
X# Which compiler & optimization flags to use
X#
XCC = cc
XOFLAGS = -O
X
X# If your system does not have a ranlib(1) command, you 
X# will have to comment out the ranlib command in the 
X# 'libufc.a' clauses
X
X#
X# End-of-configuration
X#
X
XCFLAGS   = $(OFLAGS) $(FL)
XCRYPTOBJ = crypt_util.o $(CRYPT)
X
X#
X# Sample programs for debugging/testing/benchmarking
X#
X
X# Simple test for correct operation
Xufc: ufc.c libufc.a
X	$(CC) $(CFLAGS) ufc.c libufc.a -o ufc
X
Xall: ufc speedf speedc cert
Xtests: cert ufc speedc speedf
X	./cert < ./cert.data
X	./ufc 1
X	./speedc
X	./speedf
X
X# Benchmark UFC fcrypt the crypt(3) in libc.a
Xspeedf: libufc.a speeds.c
X	$(CC) $(CFLAGS) -DFCRYPT speeds.c libufc.a -o speedf
Xspeedc: libufc.a speeds.c
X	$(CC) $(CFLAGS)          speeds.c          -o speedc
X
X# DES validation suite
Xcert: libufc.a cert.c
X	$(CC) $(CFLAGS) cert.c libufc.a -o cert
X
X#
X
Xlibufc.a: $(CRYPTOBJ)
X	ar r libufc.a $(CRYPTOBJ)
X	ranlib libufc.a
X
Xcrypt_util.o: crypt_util.c ufc-crypt.h
X
X#
X# Crypt functions
X#
X
X# Semiportable
Xcrypt.o: crypt.c ufc-crypt.h
X
X# Sun3 
Xcrypt.sun3.o: crypt.sun3.S
X	./S2o crypt.sun3.S crypt.sun3.o
X
X# HP 9000 series 300
Xcrypt.s300.o: crypt.s300.S
X	./S2o crypt.s300.S crypt.s300.o
X
X# SUN SPARC architecture
Xcrypt.sparc.o: crypt.sparc.S
X	./S2o crypt.sparc.S crypt.sparc.o
X
Xclean:
X	/bin/rm -f *.o core *~ ufc libufc.a speedf speedc tmp.s mon.out cert \
X          a.out Part*
X
Xkit:
X	makekit COPYING README Makefile S2o crypt.c speeds.c *.S crypt_util.c \
X		ufc.c cert.c cert.data patchlevel.h ufc-crypt.h
END_OF_FILE
if test 2560 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(5809 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
X
X
X	UFC-crypt: ultra fast 'crypt' implementation
X	============================================
X
X	@(#)README	2.10 01/30/92
X
XDesign goals/non goals:
X----------------------
X
X- Crypt implementation plugin compatible with crypt(3)/fcrypt.
X
X- High performance when used for password cracking.
X
X- Portable to most 32/64 bit machines.
X
X- Startup time/mixed salt performance not critical.
X
XFeatures of the implementation:
X------------------------------
X
X- Runs 30-60 times faster than crypt(3) when invoked repeated
X  times with the same salt and varying passwords.
X
X- With mostly constant salts, performance is about three times
X  that of the default fcrypt implementation shipped with Alec 
X  Muffets 'Crack' password cracker. For instructions on how to
X  plug UFC-crypt into 'Crack', see below.
X
X- With alternating salts, performance is only about twice
X  that of crypt(3).
X
X- Tested on 680x0, 386, SPARC, MIPS, HP-PA, Convex, 
X  Pyramid and IBM RS/6000 systems as well as with gcc on IBM PS/2.
X
X- Requires 165 kb for tables.
X
XAuthor & licensing etc
X----------------------
X
XUFC-crypt is written by Michael Glad, email: glad@daimi.aau.dk.
XIt is covered by the GNU library license version 2, see the file 'COPYING'.
X
XInstalling
X----------
X
XEdit the Makefile setting the variables
X
XCRYPT:	The encryption module to use; crypt.o should always work.
X        If compiling for one of the machines for which special support
X	is available, select the appropriate module.
X 
XCC:	The compiler to use.
X
XOFLAGS: The highest level of optimization available.
X
XNow run 'make'. UFC-crypt is compiled into 'libufc.a'. A test program: ufc
Xis also linked. Try it out: './ufc 1' to test proper operation.
X
XFor a more thorough test, run 'make tests'. This compiles and invokes
Xa DES validation suite as well as two benchmark programs comparing 
XUFC-crypt with the native crypt(3) implementation. If your friendly 
Xvendor has omitted crypt(3) from libc, compilation of the native 
Xbenchmark program 'speedc' will fail.
X
X'libufc.a' can be linked into your applications. It is compatible with
Xboth crypt(3) and the fcrypt shipped with Alec Muffett's Crack program.
X
XInstalling UFC-crypt into Crack:
X-------------------------------
X
XCrack Release 4.0a: in 'Sources/Makefile', change the CRACKCRYPT macro
X		    to a path leading to 'libufc.a' and invoke the Crack
X		    script as usual.
X
X4.1 and later:      Crack knows about UFC-crypt. Refer to the Crack docs
X		    for instructions.
X
XBenchmark table:
X---------------
X
XThe table shows how many operations per second UFC-crypt can
Xdo on various machines. 
X
X|--------------|-------------------------------------------|
X|Machine       |  SUN*  SUN*   HP*     DecStation   HP     |
X|              | 3/50   ELC  9000/425e    3100    9000/720 |
X|--------------|-------------------------------------------|
X| Crypt(3)/sec |  4.6    30     15         25        57    |
X| Ufc/sec      |  220   990    780       1015      3500    |
X|--------------|-------------------------------------------|
X| Speedup      |   48    30     52         40        60    |
X|--------------|-------------------------------------------|
X
X*) Compiled using special assembly language support module.
X
XIt seems as if performance is limited by CPU bus and data cache capacity. 
XThis also makes the benchmarks debatable compared to a real test with
XUFC-crypt wired into Crack. However, the table gives an outline of
Xwhat can be expected.
X
XOptimizations:
X-------------
X
XHere are the optimizations used relative to an ordinary implementation
Xsuch as the one said to be used in crypt(3).
X
XMajor optimizations
X*******************
X
X- Keep data packed as bits in integer variables -- allows for
X  fast permutations & parallel xor's in CPU hardware.
X
X- Let adjacent final & initial permutations collapse.
X
X- Keep working data in 'E expanded' format all the time.
X
X- Implement DES 'f' function mostly by table lookup
X
X- Calculate the above function on 12 bit basis rather than 6
X  as would be the most natural.
X
X- Implement setup routines so that performance is limited by the DES
X  inner loops only.
X
XMinor (dirty) optimizations
X***************************
X
X- combine iterations of DES inner loop so that DES only loops
X  8 times. This saves a lot of variable swapping.
X
X- Implement key access by a walking pointer rather than coding
X  as array indexing.
X
X- As described, the table based f function uses a 3 dimensional array:
X
X	sb ['number of 12 bit segment']['12 bit index']['48 bit half index']
X
X  Code the routine with 4 (one dimensional) vectors.
X
X- Design the internal data format & uglify the DES loops so that
X  the compiler does not need to do bit shifts when indexing vectors.
X
XPortability issues
X******************
X
XUFC-crypt does not need to know the byte endianness of the machine is runs on.
X
XTo speed up the DES inner loop, it does a dirty trick requiring the
Xavailability of a integer flavoured data type occupying exactly 32 (or 64)
Xbits. This is normally the case of 'long'. The header file 'ufc-crypt.h'
Xcontains typedefs for this type. If you have to change it (or any other part)
Xto get things working, please drop me a note.
X
XUFC-crypt can take advantage of 64 bit integers. At the moment, it is only 
Xconfigured to do so automatically for Convex machines.
X
XRevision history
X****************
X
XUFC patchlevel 0: base version; released to alt.sources on Sep 24 1991
XUFC patchlevel 1: patch released to alt.sources on Sep 27 1991.
X		  No longer rebuilds sb tables when seeing a new salt.
XUFC-crypt pl0:	  Essentially UFC pl 1. Released to comp.sources.misc
X		  on Oct 22 1991.
XUFC-crypt pl1:    Released to comp.sources.misc in February 1992
X		  * setkey/encrypt routines added
X		  * added validation/benchmarking programs
X		  * reworked keyschedule setup code
X		  * memory demands reduced
X		  * 64 bit support added
X
X
END_OF_FILE
if test 5809 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'S2o' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'S2o'\"
else
echo shar: Extracting \"'S2o'\" \(970 characters\)
sed "s/^X//" >'S2o' <<'END_OF_FILE'
X#!/bin/sh
X
X# UFC-crypt: ultra fast crypt(3) implementation
X# Copyright (C) 1991, 1992, Michael Glad, email: glad@daimi.aau.dk
X#
X# This library is free software; you can redistribute it and/or
X# modify it under the terms of the GNU Library General Public
X# License as published by the Free Software Foundation; either
X# version 2 of the License, or (at your option) any later version.
X#
X# This library is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X# Library General Public License for more details.
X#
X# You should have received a copy of the GNU Library General Public
X# License along with this library; if not, write to the Free
X# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X#
X# @(#)S2o	2.5 1/11/92
X#
X# Preprocessor compiling .S files into .o files
X#
X
X/lib/cpp -P $1 | tr \; '\012' > ./tmp.s
Xas ./tmp.s -o $2
END_OF_FILE
if test 970 -ne `wc -c <'S2o'`; then
    echo shar: \"'S2o'\" unpacked with wrong size!
fi
chmod +x 'S2o'
# end of 'S2o'
fi
if test -f 'cert.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'cert.c'\"
else
echo shar: Extracting \"'cert.c'\" \(1483 characters\)
sed "s/^X//" >'cert.c' <<'END_OF_FILE'
X
X/*
X * This crypt(3) validation program shipped with UFC-crypt
X * is derived from one distributed with Phil Karns PD DES package.
X *
X * Michael Glad, email: glad@daimi.aau.dk
X *
X * @(#)cert.c	1.4 01/13/92
X */
X
X#include <stdio.h>
X
Xint totfails = 0;
X
Xvoid good_bye () 
X{
X  if(totfails == 0) {
X    printf("Passed DES validation suite\n");
X    exit(0);
X  } else {
X    printf("%d failures during DES validation suite!!!\n", totfails);
X    exit(1);
X  }
X}
X
Xmain()
X{
X	char key[64],plain[64],cipher[64],answer[64];
X	int i;
X	int test;
X	int fail;
X
X	for(test=0;!feof(stdin);test++){
X
X		get8(key);
X		printf(" K: "); put8(key);
X		setkey(key);
X
X		get8(plain);
X		printf(" P: "); put8(plain);
X
X		get8(answer);
X		printf(" C: "); put8(answer);
X
X		for(i=0;i<64;i++)
X			cipher[i] = plain[i];
X		encrypt(cipher, 0);
X
X		for(i=0;i<64;i++)
X			if(cipher[i] != answer[i])
X				break;
X		fail = 0;
X		if(i != 64){
X			printf(" Encrypt FAIL");
X			fail++; totfails++;
X		}
X
X		encrypt(cipher, 1);
X
X		for(i=0;i<64;i++)
X			if(cipher[i] != plain[i])
X				break;
X		if(i != 64){
X			printf(" Decrypt FAIL");
X			fail++; totfails++;
X		}
X
X		if(fail == 0)
X			printf(" OK");
X		printf("\n");
X	}
X	good_bye();
X}
Xget8(cp)
Xchar *cp;
X{
X	int i,j,t;
X
X	for(i=0;i<8;i++){
X		scanf("%2x",&t);
X		if(feof(stdin))
X		  good_bye();
X		for(j=0; j<8 ; j++) {
X		  *cp++ = (t & (0x01 << (7-j))) != 0;
X		}
X	}
X}
Xput8(cp)
Xchar *cp;
X{
X	int i,j,t;
X
X	for(i=0;i<8;i++){
X	  t = 0;
X	  for(j = 0; j<8; j++) 
X	    t = (t<<1) | *cp++;
X	  printf("%02x", t);
X	}
X}
X
X
X
X
END_OF_FILE
if test 1483 -ne `wc -c <'cert.c'`; then
    echo shar: \"'cert.c'\" unpacked with wrong size!
fi
# end of 'cert.c'
fi
if test -f 'cert.data' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'cert.data'\"
else
echo shar: Extracting \"'cert.data'\" \(8721 characters\)
sed "s/^X//" >'cert.data' <<'END_OF_FILE'
X0101010101010101 95f8a5e5dd31d900 8000000000000000
X0101010101010101 dd7f121ca5015619 4000000000000000
X0101010101010101 2e8653104f3834ea 2000000000000000
X0101010101010101 4bd388ff6cd81d4f 1000000000000000
X0101010101010101 20b9e767b2fb1456 0800000000000000
X0101010101010101 55579380d77138ef 0400000000000000
X0101010101010101 6cc5defaaf04512f 0200000000000000
X0101010101010101 0d9f279ba5d87260 0100000000000000
X0101010101010101 d9031b0271bd5a0a 0080000000000000
X0101010101010101 424250b37c3dd951 0040000000000000
X0101010101010101 b8061b7ecd9a21e5 0020000000000000
X0101010101010101 f15d0f286b65bd28 0010000000000000
X0101010101010101 add0cc8d6e5deba1 0008000000000000
X0101010101010101 e6d5f82752ad63d1 0004000000000000
X0101010101010101 ecbfe3bd3f591a5e 0002000000000000
X0101010101010101 f356834379d165cd 0001000000000000
X0101010101010101 2b9f982f20037fa9 0000800000000000
X0101010101010101 889de068a16f0be6 0000400000000000
X0101010101010101 e19e275d846a1298 0000200000000000
X0101010101010101 329a8ed523d71aec 0000100000000000
X0101010101010101 e7fce22557d23c97 0000080000000000
X0101010101010101 12a9f5817ff2d65d 0000040000000000
X0101010101010101 a484c3ad38dc9c19 0000020000000000
X0101010101010101 fbe00a8a1ef8ad72 0000010000000000
X0101010101010101 750d079407521363 0000008000000000
X0101010101010101 64feed9c724c2faf 0000004000000000
X0101010101010101 f02b263b328e2b60 0000002000000000
X0101010101010101 9d64555a9a10b852 0000001000000000
X0101010101010101 d106ff0bed5255d7 0000000800000000
X0101010101010101 e1652c6b138c64a5 0000000400000000
X0101010101010101 e428581186ec8f46 0000000200000000
X0101010101010101 aeb5f5ede22d1a36 0000000100000000
X0101010101010101 e943d7568aec0c5c 0000000080000000
X0101010101010101 df98c8276f54b04b 0000000040000000
X0101010101010101 b160e4680f6c696f 0000000020000000
X0101010101010101 fa0752b07d9c4ab8 0000000010000000
X0101010101010101 ca3a2b036dbc8502 0000000008000000
X0101010101010101 5e0905517bb59bcf 0000000004000000
X0101010101010101 814eeb3b91d90726 0000000002000000
X0101010101010101 4d49db1532919c9f 0000000001000000
X0101010101010101 25eb5fc3f8cf0621 0000000000800000
X0101010101010101 ab6a20c0620d1c6f 0000000000400000
X0101010101010101 79e90dbc98f92cca 0000000000200000
X0101010101010101 866ecedd8072bb0e 0000000000100000
X0101010101010101 8b54536f2f3e64a8 0000000000080000
X0101010101010101 ea51d3975595b86b 0000000000040000
X0101010101010101 caffc6ac4542de31 0000000000020000
X0101010101010101 8dd45a2ddf90796c 0000000000010000
X0101010101010101 1029d55e880ec2d0 0000000000008000
X0101010101010101 5d86cb23639dbea9 0000000000004000
X0101010101010101 1d1ca853ae7c0c5f 0000000000002000
X0101010101010101 ce332329248f3228 0000000000001000
X0101010101010101 8405d1abe24fb942 0000000000000800
X0101010101010101 e643d78090ca4207 0000000000000400
X0101010101010101 48221b9937748a23 0000000000000200
X0101010101010101 dd7c0bbd61fafd54 0000000000000100
X0101010101010101 2fbc291a570db5c4 0000000000000080
X0101010101010101 e07c30d7e4e26e12 0000000000000040
X0101010101010101 0953e2258e8e90a1 0000000000000020
X0101010101010101 5b711bc4ceebf2ee 0000000000000010
X0101010101010101 cc083f1e6d9e85f6 0000000000000008
X0101010101010101 d2fd8867d50d2dfe 0000000000000004
X0101010101010101 06e7ea22ce92708f 0000000000000002
X0101010101010101 166b40b44aba4bd6 0000000000000001
X8001010101010101 0000000000000000 95a8d72813daa94d
X4001010101010101 0000000000000000 0eec1487dd8c26d5
X2001010101010101 0000000000000000 7ad16ffb79c45926
X1001010101010101 0000000000000000 d3746294ca6a6cf3
X0801010101010101 0000000000000000 809f5f873c1fd761
X0401010101010101 0000000000000000 c02faffec989d1fc
X0201010101010101 0000000000000000 4615aa1d33e72f10
X0180010101010101 0000000000000000 2055123350c00858
X0140010101010101 0000000000000000 df3b99d6577397c8
X0120010101010101 0000000000000000 31fe17369b5288c9
X0110010101010101 0000000000000000 dfdd3cc64dae1642
X0108010101010101 0000000000000000 178c83ce2b399d94
X0104010101010101 0000000000000000 50f636324a9b7f80
X0102010101010101 0000000000000000 a8468ee3bc18f06d
X0101800101010101 0000000000000000 a2dc9e92fd3cde92
X0101400101010101 0000000000000000 cac09f797d031287
X0101200101010101 0000000000000000 90ba680b22aeb525
X0101100101010101 0000000000000000 ce7a24f350e280b6
X0101080101010101 0000000000000000 882bff0aa01a0b87
X0101040101010101 0000000000000000 25610288924511c2
X0101020101010101 0000000000000000 c71516c29c75d170
X0101018001010101 0000000000000000 5199c29a52c9f059
X0101014001010101 0000000000000000 c22f0a294a71f29f
X0101012001010101 0000000000000000 ee371483714c02ea
X0101011001010101 0000000000000000 a81fbd448f9e522f
X0101010801010101 0000000000000000 4f644c92e192dfed
X0101010401010101 0000000000000000 1afa9a66a6df92ae
X0101010201010101 0000000000000000 b3c1cc715cb879d8
X0101010180010101 0000000000000000 19d032e64ab0bd8b
X0101010140010101 0000000000000000 3cfaa7a7dc8720dc
X0101010120010101 0000000000000000 b7265f7f447ac6f3
X0101010110010101 0000000000000000 9db73b3c0d163f54
X0101010108010101 0000000000000000 8181b65babf4a975
X0101010104010101 0000000000000000 93c9b64042eaa240
X0101010102010101 0000000000000000 5570530829705592
X0101010101800101 0000000000000000 8638809e878787a0
X0101010101400101 0000000000000000 41b9a79af79ac208
X0101010101200101 0000000000000000 7a9be42f2009a892
X0101010101100101 0000000000000000 29038d56ba6d2745
X0101010101080101 0000000000000000 5495c6abf1e5df51
X0101010101040101 0000000000000000 ae13dbd561488933
X0101010101020101 0000000000000000 024d1ffa8904e389
X0101010101018001 0000000000000000 d1399712f99bf02e
X0101010101014001 0000000000000000 14c1d7c1cffec79e
X0101010101012001 0000000000000000 1de5279dae3bed6f
X0101010101011001 0000000000000000 e941a33f85501303
X0101010101010801 0000000000000000 da99dbbc9a03f379
X0101010101010401 0000000000000000 b7fc92f91d8e92e9
X0101010101010201 0000000000000000 ae8e5caa3ca04e85
X0101010101010180 0000000000000000 9cc62df43b6eed74
X0101010101010140 0000000000000000 d863dbb5c59a91a0
X0101010101010120 0000000000000000 a1ab2190545b91d7
X0101010101010110 0000000000000000 0875041e64c570f7
X0101010101010108 0000000000000000 5a594528bebef1cc
X0101010101010104 0000000000000000 fcdb3291de21f0c0
X0101010101010102 0000000000000000 869efd7f9f265a09
X1046913489980131 0000000000000000 88d55e54f54c97b4
X1007103489988020 0000000000000000 0c0cc00c83ea48fd
X10071034c8980120 0000000000000000 83bc8ef3a6570183
X1046103489988020 0000000000000000 df725dcad94ea2e9
X1086911519190101 0000000000000000 e652b53b550be8b0
X1086911519580101 0000000000000000 af527120c485cbb0
X5107b01519580101 0000000000000000 0f04ce393db926d5
X1007b01519190101 0000000000000000 c9f00ffc74079067
X3107915498080101 0000000000000000 7cfd82a593252b4e
X3107919498080101 0000000000000000 cb49a2f9e91363e3
X10079115b9080140 0000000000000000 00b588be70d23f56
X3107911598090140 0000000000000000 406a9a6ab43399ae
X1007d01589980101 0000000000000000 6cb773611dca9ada
X9107911589980101 0000000000000000 67fd21c17dbb5d70
X9107d01589190101 0000000000000000 9592cb4110430787
X1007d01598980120 0000000000000000 a6b7ff68a318ddd3
X1007940498190101 0000000000000000 4d102196c914ca16
X0107910491190401 0000000000000000 2dfa9f4573594965
X0107910491190101 0000000000000000 b46604816c0e0774
X0107940491190401 0000000000000000 6e7e6221a4f34e87
X19079210981a0101 0000000000000000 aa85e74643233199
X1007911998190801 0000000000000000 2e5a19db4d1962d6
X10079119981a0801 0000000000000000 23a866a809d30894
X1007921098190101 0000000000000000 d812d961f017d320
X100791159819010b 0000000000000000 055605816e58608f
X1004801598190101 0000000000000000 abd88e8b1b7716f1
X1004801598190102 0000000000000000 537ac95be69da1e1
X1004801598190108 0000000000000000 aed0f6ae3c25cdd8
X1002911598100104 0000000000000000 b3e35a5ee53e7b8d
X1002911598190104 0000000000000000 61c79c71921a2ef8
X1002911598100201 0000000000000000 e2f5728f0995013c
X1002911698100101 0000000000000000 1aeac39a61f0a464
X7ca110454a1a6e57 01a1d6d039776742 690f5b0d9a26939b
X0131d9619dc1376e 5cd54ca83def57da 7a389d10354bd271
X07a1133e4a0b2686 0248d43806f67172 868ebb51cab4599a
X3849674c2602319e 51454b582ddf440a 7178876e01f19b2a
X04b915ba43feb5b6 42fd443059577fa2 af37fb421f8c4095
X0113b970fd34f2ce 059b5e0851cf143a 86a560f10ec6d85b
X0170f175468fb5e6 0756d8e0774761d2 0cd3da020021dc09
X43297fad38e373fe 762514b829bf486a ea676b2cb7db2b7a
X07a7137045da2a16 3bdd119049372802 dfd64a815caf1a0f
X04689104c2fd3b2f 26955f6835af609a 5c513c9c4886c088
X37d06bb516cb7546 164d5e404f275232 0a2aeeae3ff4ab77
X1f08260d1ac2465e 6b056e18759f5cca ef1bf03e5dfa575a
X584023641aba6176 004bd6ef09176062 88bf0db6d70dee56
X025816164629b007 480d39006ee762f2 a1f9915541020b56
X49793ebc79b3258f 437540c8698f3cfa 6fbf1cafcffd0556
X4fb05e1515ab73a7 072d43a077075292 2f22e49bab7ca1ac
X49e95d6d4ca229bf 02fe55778117f12a 5a6b612cc26cce4a
X018310dc409b26d6 1d9d5c5018f728c2 5f4c038ed12b2e41
X1c587f1c13924fef 305532286d6f295a 63fac0d034d9f793
END_OF_FILE
if test 8721 -ne `wc -c <'cert.data'`; then
    echo shar: \"'cert.data'\" unpacked with wrong size!
fi
# end of 'cert.data'
fi
if test -f 'crypt.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'crypt.c'\"
else
echo shar: Extracting \"'crypt.c'\" \(3256 characters\)
sed "s/^X//" >'crypt.c' <<'END_OF_FILE'
X/*
X * UFC-crypt: ultra fast crypt(3) implementation
X *
X * Copyright (C) 1991, 1992, Michael Glad, email: glad@daimi.aau.dk
X *
X * This library is free software; you can redistribute it and/or
X * modify it under the terms of the GNU Library General Public
X * License as published by the Free Software Foundation; either
X * version 2 of the License, or (at your option) any later version.
X *
X * This library is distributed in the hope that it will be useful,
X * but WITHOUT ANY WARRANTY; without even the implied warranty of
X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X * Library General Public License for more details.
X * 
X * You should have received a copy of the GNU Library General Public
X * License along with this library; if not, write to the Free
X * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X *
X * @(#)crypt.c	2.14 01/23/92
X *
X * Semiportable C version
X *
X */
X
X#include "ufc-crypt.h"
X
Xextern ufc_long *ufc_dofinalperm();
X
X#ifdef _UFC_32_
X
X/*
X * 32 bit version
X */
X
Xextern long32 ufc_keytab[16][2];
Xextern long32 ufc_sb0[], ufc_sb1[], ufc_sb2[], ufc_sb3[];
X
X#define SBA(sb, v) (*(long32*)((char*)(sb)+(v)))
X
Xufc_long *ufc_doit(l1, l2, r1, r2, itr)
X  ufc_long l1, l2, r1, r2, itr;
X  { int i;
X    long32 s, *k;
X
X    while(itr--) {
X      k = &ufc_keytab[0][0];
X      for(i=8; i--; ) {
X	s = *k++ ^ r1;
X	l1 ^= SBA(ufc_sb1, s & 0xffff); l2 ^= SBA(ufc_sb1, (s & 0xffff) + 4);  
X        l1 ^= SBA(ufc_sb0, s >>= 16);   l2 ^= SBA(ufc_sb0, (s)          + 4); 
X        s = *k++ ^ r2; 
X        l1 ^= SBA(ufc_sb3, s & 0xffff); l2 ^= SBA(ufc_sb3, (s & 0xffff) + 4);
X        l1 ^= SBA(ufc_sb2, s >>= 16);   l2 ^= SBA(ufc_sb2, (s)          + 4);
X
X        s = *k++ ^ l1; 
X        r1 ^= SBA(ufc_sb1, s & 0xffff); r2 ^= SBA(ufc_sb1, (s & 0xffff) + 4);  
X        r1 ^= SBA(ufc_sb0, s >>= 16);   r2 ^= SBA(ufc_sb0, (s)          + 4); 
X        s = *k++ ^ l2; 
X        r1 ^= SBA(ufc_sb3, s & 0xffff); r2 ^= SBA(ufc_sb3, (s & 0xffff) + 4);  
X        r1 ^= SBA(ufc_sb2, s >>= 16);   r2 ^= SBA(ufc_sb2, (s)          + 4);
X      } 
X      s=l1; l1=r1; r1=s; s=l2; l2=r2; r2=s;
X    }
X    return ufc_dofinalperm(l1, l2, r1, r2);
X  }
X
X#endif
X
X#ifdef _UFC_64_
X
X/*
X * 64 bit version
X */
X
Xextern long64 ufc_keytab[16];
Xextern long64 ufc_sb0[], ufc_sb1[], ufc_sb2[], ufc_sb3[];
X
X#ifdef cray
X#define SBA(sb, v) (*(long64*)((long64)(sb)+(v)))
X#else
X#define SBA(sb, v) (*(long64*)((char*)(sb)+(v)))
X#endif
X
Xufc_long *ufc_doit(l1, l2, r1, r2, itr)
X  ufc_long l1, l2, r1, r2, itr;
X  { int i;
X    long64 l, r, s, *k;
X
X    l = (((long64)l1) << 32) | ((long64)l2);
X    r = (((long64)r1) << 32) | ((long64)r2);
X
X    while(itr--) {
X      k = &ufc_keytab[0];
X      for(i=8; i--; ) {
X	s = *k++ ^ r;
X	l ^= SBA(ufc_sb3, (s >>  0) & 0xffff);
X        l ^= SBA(ufc_sb2, (s >> 16) & 0xffff);
X        l ^= SBA(ufc_sb1, (s >> 32) & 0xffff);
X        l ^= SBA(ufc_sb0, (s >> 48) & 0xffff);
X
X	s = *k++ ^ l;
X	r ^= SBA(ufc_sb3, (s >>  0) & 0xffff);
X        r ^= SBA(ufc_sb2, (s >> 16) & 0xffff);
X        r ^= SBA(ufc_sb1, (s >> 32) & 0xffff);
X        r ^= SBA(ufc_sb0, (s >> 48) & 0xffff);
X      } 
X      s=l; l=r; r=s;
X    }
X
X    l1 = l >> 32; l2 = l & 0xffffffff;
X    r1 = r >> 32; r2 = r & 0xffffffff;
X    return ufc_dofinalperm(l1, l2, r1, r2);
X  }
X
X#endif
END_OF_FILE
if test 3256 -ne `wc -c <'crypt.c'`; then
    echo shar: \"'crypt.c'\" unpacked with wrong size!
fi
# end of 'crypt.c'
fi
if test -f 'crypt.s300.S' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'crypt.s300.S'\"
else
echo shar: Extracting \"'crypt.s300.S'\" \(2306 characters\)
sed "s/^X//" >'crypt.s300.S' <<'END_OF_FILE'
X #
X # UFC-crypt: ultra fast crypt(3) implementation
X # Copyright (C) 1991, 1992, Michael Glad, email: glad@daimi.aau.dk
X #
X # This library is free software, you can redistribute it and/or
X # modify it under the terms of the GNU Library General Public
X # License as published by the Free Software Foundation, either
X # version 2 of the License, or (at your option) any later version.
X #
X # This library is distributed in the hope that it will be useful,
X # but WITHOUT ANY WARRANTY, without even the implied warranty of
X # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X # Library General Public License for more details.
X #
X # You should have received a copy of the GNU Library General Public
X # License along with this library, if not, write to the Free
X # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X #
X # @(#)crypt.s300.S	2.5 12/30/91
X #
X # MC680x0/Hp9000 s300/s400 assembly code
X #
X
X#define L1	%d0
X#define L2	%d1
X#define R1	%d2
X#define R2	%d3
X#define SCR1	%d4
X#define SCR2	%d5
X
X#define I	%d7
X#define ITR	24(%a6)
X
X#define SB0	%a0
X#define SB1	%a1
X#define SB2	%a2
X#define SB3	%a3
X#define KPTR	%a4
X	
X#define F(I,O1,O2,SBX,SBY)						\
X	mov.l 	(KPTR)+,SCR1 ;		eor.l 	I,SCR1 ;		\
X	mov.l	0(SBX,SCR1.w),SCR2 ; 	eor.l	SCR2,O1 ;		\
X	mov.l	4(SBX,SCR1.w),SCR2 ;	eor.l	SCR2,O2 ;		\
X	swap.w	SCR1 ;							\
X	mov.l	0(SBY,SCR1.w),SCR2 ;	eor.l	SCR2,O1 ;		\
X	mov.l	4(SBY,SCR1.w),SCR2 ;	eor.l	SCR2,O2 ;
X
X#define G(I1,I2,O1,O2)			\
X	F(I1,O1,O2,SB1,SB0) F(I2,O1,O2,SB3,SB2)
X
X#define H G(R1,R2,L1,L2) ; G(L1,L2,R1,R2)
X
X	text
X	global _ufc_doit
X_ufc_doit:
X #
X # Preamble
X #
X	link    %a6,&-56
X	movem.l &15612,(%sp)
X
X	mov.l   20(%a6),R2 
X	mov.l   16(%a6),R1 
X	mov.l   12(%a6),L2 
X	mov.l    8(%a6),L1
X #
X # Setup address registers with sb pointers
X #
X	mov.l	&_ufc_sb0,SB0 ; mov.l &_ufc_sb1,SB1 
X	mov.l   &_ufc_sb2,SB2 ; mov.l &_ufc_sb3,SB3
X #
X # And loop...
X #
XLagain:	
X	mov.l	&_ufc_keytab,KPTR
X	moveq	&8,I
XLagain1:
X	H
X	subq.l	&1,I
X	bne	Lagain1
X # Permute
X	mov.l L1,SCR1 ; mov.l R1,L1 ; mov.l SCR1,R1
X	mov.l L2,SCR1 ; mov.l R2,L2 ; mov.l SCR1,R2
X #
X	subq.l	&1,ITR
X	tst.l	ITR
X	bne	Lagain
X #
X # Output conversion
X #
X	mov.l R2,-(%sp) ; mov.l R1,-(%sp) 
X	mov.l L2,-(%sp) ; mov.l L1,-(%sp)
X	jsr _ufc_dofinalperm ; add.l &16,%sp
X #
X # Postamble
X #
X	movem.l	(-56)(%a6),&15612 ; unlk %a6 ; rts
X
X
X
END_OF_FILE
if test 2306 -ne `wc -c <'crypt.s300.S'`; then
    echo shar: \"'crypt.s300.S'\" unpacked with wrong size!
fi
# end of 'crypt.s300.S'
fi
if test -f 'crypt.sparc.S' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'crypt.sparc.S'\"
else
echo shar: Extracting \"'crypt.sparc.S'\" \(2512 characters\)
sed "s/^X//" >'crypt.sparc.S' <<'END_OF_FILE'
X!
X! UFC-crypt: ultra fast crypt(3) implementation
X! Copyright (C) 1991, 1992, Michael Glad, email: glad@daimi.aau.dk
X!
X! This library is free software, you can redistribute it and/or
X! modify it under the terms of the GNU Library General Public
X! License as published by the Free Software Foundation, either
X! version 2 of the License, or (at your option) any later version.
X!
X! This library is distributed in the hope that it will be useful,
X! but WITHOUT ANY WARRANTY, without even the implied warranty of
X! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X! Library General Public License for more details.
X!
X! You should have received a copy of the GNU Library General Public
X! License along with this library, if not, write to the Free
X! Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X!
X! @(#)crypt.sparc.S	2.5 12/30/91
X!
X! Assembly code for SPARC architecture machines
X!
X
X#define I	%i3
X#define ITR	%i4
X
X#define L1	%o0
X#define L2	%o1
X#define R1	%o2
X#define R2	%o3
X
X#define KPTR	%g1
X#define MASK	%g2
X#define SCR1a	%g3
X#define SCR1b	%g4
X#define SCR1	%g5
X#define SCR2    %g6
X#define SCR3	%g7
X
X#define SB0a	%l0
X#define SB0b	%l1
X#define SB1a	%l2
X#define SB1b	%l3
X#define SB2a	%l4
X#define SB2b	%l5
X#define SB3a	%l6
X#define SB3b	%l7
X
X#define ASSIGN(reg,value) sethi %hi(value),reg ; or %lo(value),reg,reg ;
X
X
X#define F(I,O1,O2,SBX1,SBX2,SBY1,SBY2)				\
X	ld 	[KPTR],SCR1 ;					\
X	xor	SCR1,I,SCR1 ; 					\
X 	and	SCR1,MASK,SCR1a ;				\
X								\
X	ld	[SBX1+SCR1a],SCR2 ;	inc	4,KPTR ;	\
X 	srl	SCR1,16,SCR1b ;					\
X	ld	[SBX2+SCR1a],SCR3 ;	xor	SCR2,O1,O1 ;	\
X								\
X	ld	[SBY1+SCR1b],SCR2 ;	xor 	SCR3,O2,O2 ;	\
X	ld	[SBY2+SCR1b],SCR3 ;	xor 	SCR2,O1,O1 ;	\
X								\
X	xor 	SCR3,O2,O2 ;
X
X#define G(I1,I2,O1,O2)			\
X	F(I1,O1,O2,SB1a,SB1b,SB0a,SB0b) F(I2,O1,O2,SB3a,SB3b,SB2a,SB2b)
X
X#define H G(R1,R2,L1,L2) ; G(L1,L2,R1,R2)
X
X	.seg	"text"
X	.global	_ufc_doit
X
X_ufc_doit:
X!
X! Preamble
X!
X	save    %sp,-104,%sp
X	mov %i0,L1 ;	mov %i1,L2
X	mov %i2,R1 ;	mov %i3,R2
X!
X! Set up sb pointers
X!
X	ASSIGN(SB0a,_ufc_sb0) ; add SB0a,4,SB0b
X	ASSIGN(SB1a,_ufc_sb1) ; add SB1a,4,SB1b 
X	ASSIGN(SB2a,_ufc_sb2) ; add SB2a,4,SB2b
X	ASSIGN(SB3a,_ufc_sb3) ; add SB3a,4,SB3b
X!
X	ASSIGN(MASK,0xffff)
X!
X! Loop
X!
XLagain:
X	ASSIGN(KPTR,_ufc_keytab)
X	ASSIGN(I, 8)
XLagain1:
X	H
X	deccc	I
X	bnz 	Lagain1
X	nop
X! Permute
X	mov L1,SCR1 ; mov R1,L1 ; mov SCR1,R1
X	mov L2,SCR1 ; mov R2,L2 ; mov SCR1,R2
X!
X	deccc 	ITR
X	bnz 	Lagain
X	nop
X!
X! Output conversion
X!
X	call	_ufc_dofinalperm,4
X	nop
X!
X! Postamble
X!
X	ret ; restore %g0,%o0,%o0
END_OF_FILE
if test 2512 -ne `wc -c <'crypt.sparc.S'`; then
    echo shar: \"'crypt.sparc.S'\" unpacked with wrong size!
fi
# end of 'crypt.sparc.S'
fi
if test -f 'crypt.sun3.S' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'crypt.sun3.S'\"
else
echo shar: Extracting \"'crypt.sun3.S'\" \(2218 characters\)
sed "s/^X//" >'crypt.sun3.S' <<'END_OF_FILE'
X|
X| UFC-crypt: ultra fast crypt(3) implementation
X| Copyright (C) 1991, 1992, Michael Glad, email: glad@daimi.aau.dk
X|
X| This library is free software, you can redistribute it and/or
X| modify it under the terms of the GNU Library General Public
X| License as published by the Free Software Foundation, either
X| version 2 of the License, or (at your option) any later version.
X|
X| This library is distributed in the hope that it will be useful,
X| but WITHOUT ANY WARRANTY, without even the implied warranty of
X| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X| Library General Public License for more details.
X|
X| You should have received a copy of the GNU Library General Public
X| License along with this library, if not, write to the Free
X| Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X|
X| @(#)crypt.sun3.S	2.8 01/11/92
X|
X| Assembly code for SUN3 68000 based workstations.
X|
X
X#define L1	d0
X#define L2	d1
X#define R1	d2
X#define R2	d3
X#define SCR1	d4
X#define SCR2	d5
X
X#define I       d7
X#define ITR	a6@(24)
X
X#define SB0	a0
X#define SB1	a1
X#define SB2	a2
X#define SB3	a3
X#define KPTR	a4
X	
X#define F(I,O1,O2,SBX,SBY)						\
X	movl 	KPTR@+,SCR1 ;		eorl 	I,SCR1 ;		\
X	movl	SBX@(0,SCR1:w),SCR2 ; 	eorl	SCR2,O1 ;		\
X	movl	SBX@(4,SCR1:w),SCR2 ;	eorl	SCR2,O2 ;		\
X	swap	SCR1 ;							\
X	movl	SBY@(0,SCR1:w),SCR2 ;	eorl	SCR2,O1 ;		\
X	movl	SBY@(4,SCR1:w),SCR2 ;	eorl	SCR2,O2 ;
X
X#define G(I1,I2,O1,O2)			\
X	F(I1,O1,O2,SB1,SB0) F(I2,O1,O2,SB3,SB2)
X
X#define H G(R1,R2,L1,L2) ; G(L1,L2,R1,R2)
X
X	.text
X	.proc
X	.globl _ufc_doit
X_ufc_doit:
X|
X| Preamble
X|
X	link a6,#-56
X	moveml #15612,sp@
X
X	movl	a6@(20),R2
X	movl	a6@(16),R1
X	movl	a6@(12),L2
X	movl	a6@(8),L1
X|
X| Setup address registers with sb pointers
X|
X	movl	#_ufc_sb0,SB0 ; movl #_ufc_sb1,SB1 
X	movl    #_ufc_sb2,SB2 ; movl #_ufc_sb3,SB3
X| 
X| And loop...
X|
XLagain:	
X	movl  #_ufc_keytab,KPTR
X	moveq #8,I
XLagain1:
X	H
X	subql #1,I
X	tstl  I
X	jne   Lagain1	
X| Permute
X	movl L1,SCR1 ; movl R1,L1 ; movl SCR1,R1
X	movl L2,SCR1 ; movl R2,L2 ; movl SCR1,R2
X|
X	subql	#1,ITR
X	jne	Lagain
X|
X| Output conversion
X|
X	movl R2,sp@- ; movl R1,sp@-
X	movl L2,sp@- ; movl L1,sp@-
X	jbsr _ufc_dofinalperm ; addl #16,sp
X|
X| Postamble
X|
X	moveml 	a6@(-56),#15612 ; unlk a6 ; rts
END_OF_FILE
if test 2218 -ne `wc -c <'crypt.sun3.S'`; then
    echo shar: \"'crypt.sun3.S'\" unpacked with wrong size!
fi
# end of 'crypt.sun3.S'
fi
if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patchlevel.h'\"
else
echo shar: Extracting \"'patchlevel.h'\" \(967 characters\)
sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
X/*
X * UFC-crypt: ultra fast crypt(3) implementation
X *
X * Copyright (C) 1991, 1992, Michael Glad, email: glad@daimi.aau.dk
X *
X * This library is free software; you can redistribute it and/or
X * modify it under the terms of the GNU Library General Public
X * License as published by the Free Software Foundation; either
X * version 2 of the License, or (at your option) any later version.
X *
X * This library is distributed in the hope that it will be useful,
X * but WITHOUT ANY WARRANTY; without even the implied warranty of
X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X * Library General Public License for more details.
X 
X * You should have received a copy of the GNU Library General Public
X * License along with this library; if not, write to the Free
X * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X *
X * @(#)patchlevel.h	1.6 01/31/92
X *
X */
X
X#define PATCHLEVEL "UFC-crypt, patchlevel 1a, @(#)patchlevel.h	1.6 01/31/92"
END_OF_FILE
if test 967 -ne `wc -c <'patchlevel.h'`; then
    echo shar: \"'patchlevel.h'\" unpacked with wrong size!
fi
# end of 'patchlevel.h'
fi
if test -f 'speeds.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'speeds.c'\"
else
echo shar: Extracting \"'speeds.c'\" \(1290 characters\)
sed "s/^X//" >'speeds.c' <<'END_OF_FILE'
X/*
X * This fcrypt/crypt speed testing program
X * is derived from one floating around in
X * the net. It's distributed along with
X * UFC-crypt but is not.
X *
X * Michael Glad, email: glad@daimi.aau.dk
X *
X * @(#)speeds.c	1.5 01/23/92
X */
X
X#include <sys/time.h>
X#include <signal.h>
X#include <stdio.h>
X
Xstatic int cnt;
X#define ITIME	10		/* Number of seconds to run test. */
X
Xvoid
XStop ()
X{
X    printf ("Did %f %s()s per second.\n",
X	    ((float) cnt) / ((float) ITIME),
X#if defined(FCRYPT)
X	    "fcrypt"
X#else
X	    "crypt"
X#endif
X    );
X    exit (0);
X}
X
X/*
X * Silly rewrite of 'bzero'. I do so
X * because some machines don't have
X * bzero and some don't have memset.
X */
X
Xstatic void clearmem(start, cnt)
X  char *start;
X  int cnt;
X  { while(cnt--)
X      *start++ = '\0';
X  }
X
Xmain ()
X{
X    struct itimerval itv;
X
X    clearmem (&itv, sizeof (itv));
X
X    printf ("Running %s for %d seconds of virtual time ...\n",
X#ifdef FCRYPT
X    "UFC-crypt",
X#else
X    "crypt(libc)",
X#endif
X	    ITIME);
X
X#ifdef FCRYPT
X    init_des ();
X#endif
X
X    signal (SIGVTALRM, Stop);
X    itv.it_value.tv_sec = ITIME;
X    itv.it_value.tv_usec = 0;
X    setitimer (ITIMER_VIRTUAL, &itv, NULL);
X
X    for (cnt = 0;; cnt++)
X    {
X#ifdef FCRYPT
X	fcrypt ("fredfred", "eek");
X#else
X	crypt ("fredfred", "eek");
X#endif
X    }
X}
X
X
X
X
X
X
END_OF_FILE
if test 1290 -ne `wc -c <'speeds.c'`; then
    echo shar: \"'speeds.c'\" unpacked with wrong size!
fi
# end of 'speeds.c'
fi
if test -f 'ufc-crypt.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ufc-crypt.h'\"
else
echo shar: Extracting \"'ufc-crypt.h'\" \(2257 characters\)
sed "s/^X//" >'ufc-crypt.h' <<'END_OF_FILE'
X/*
X * UFC-crypt: ultra fast crypt(3) implementation
X *
X * Copyright (C) 1991, 1992, Michael Glad, email: glad@daimi.aau.dk
X *
X * This library is free software; you can redistribute it and/or
X * modify it under the terms of the GNU Library General Public
X * License as published by the Free Software Foundation; either
X * version 2 of the License, or (at your option) any later version.
X *
X * This library is distributed in the hope that it will be useful,
X * but WITHOUT ANY WARRANTY; without even the implied warranty of
X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X * Library General Public License for more details.
X 
X * You should have received a copy of the GNU Library General Public
X * License along with this library; if not, write to the Free
X * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X *
X * @(#)ufc-crypt.h	1.11 01/20/92
X *
X * Definitions of datatypes 
X * 
X */
X
X/* 
X * Requirements for datatypes:
X * 
X * A datatype 'ufc_long' of at least 32 bit
X * *and*
X *   A type 'long32' of exactly 32 bits (_UFC_32_)
X *   *or*
X *   A type 'long64' of exactly 64 bits (_UFC_64_)
X *
X * 'int' is assumed to be at least 8 bit
X */
X
X/*
X * #ifdef's for various architectures
X */
X
X#ifdef cray
X/* Cray: all integer flavoured
X   datatypes are 64 bit wide.
X
X   Not tested -- please notify me
X   if you are able to test it.
X*/
Xtypedef unsigned long ufc_long;
Xtypedef unsigned long long64;
X#define _UFC_64_
X#endif
X
X#ifdef convex
X/* thanks to pcl@convex.oxford.ac.uk (Paul Leyland) for testing */
Xtypedef unsigned long ufc_long;
Xtypedef long long     long64;
X#define _UFC_64_
X#endif
X
X/*
X * For debugging 64 bit code etc with 'gcc'
X */
X
X#ifdef GCC3232
Xtypedef unsigned long ufc_long;
Xtypedef unsigned long long32;
X#define _UFC_32_
X#endif
X
X#ifdef GCC3264
Xtypedef unsigned long ufc_long;
Xtypedef long long     long64;
X#define _UFC_64_
X#endif
X
X#ifdef GCC6432
Xtypedef long long ufc_long;
Xtypedef unsigned long long32;
X#define _UFC_32_
X#endif
X
X#ifdef GCC6464
Xtypedef long long     ufc_long;
Xtypedef long long     long64;
X#define _UFC_64_
X#endif
X
X/*
X * Catch all for 99.95% of all UNIX machines
X */
X
X#ifndef _UFC_64_
X#ifndef _UFC_32_
X#define _UFC_32_
Xtypedef unsigned      ufc_long;
Xtypedef unsigned long long32;
X#endif
X#endif
X
X
END_OF_FILE
if test 2257 -ne `wc -c <'ufc-crypt.h'`; then
    echo shar: \"'ufc-crypt.h'\" unpacked with wrong size!
fi
# end of 'ufc-crypt.h'
fi
if test -f 'ufc.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ufc.c'\"
else
echo shar: Extracting \"'ufc.c'\" \(1471 characters\)
sed "s/^X//" >'ufc.c' <<'END_OF_FILE'
X/*
X * UFC-crypt: ultra fast crypt(3) implementation
X *
X * Copyright (C) 1991, 1992, Michael Glad, email: glad@daimi.aau.dk
X *
X * This library is free software; you can redistribute it and/or
X * modify it under the terms of the GNU Library General Public
X * License as published by the Free Software Foundation; either
X * version 2 of the License, or (at your option) any later version.
X *
X * This library is distributed in the hope that it will be useful,
X * but WITHOUT ANY WARRANTY; without even the implied warranty of
X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X * Library General Public License for more details.
X 
X * You should have received a copy of the GNU Library General Public
X * License along with this library; if not, write to the Free
X * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X *
X * @(#)ufc.c	2.4 12/30/91
X *
X * Stub main program for debugging
X * and benchmarking.
X *
X */
X
X#include <stdio.h>
X
Xchar *crypt();
X
Xmain(argc, argv)
X  int argc;
X  char **argv;
X  { char *s;
X    unsigned long i,iterations;
X
X    if(argc != 2) {
X      fprintf(stderr, "usage: ufc iterations\n");
X      exit(1);
X    }
X    argv++;
X    iterations = atoi(*argv);
X    printf("ufc: running %d iterations\n", iterations);
X
X    for(i=0; i<iterations; i++)
X      s=crypt("foob","ar");
X    if(strcmp(s, "arlEKn0OzVJn.") == 0)
X      printf("OK\n");
X    else {
X      printf("wrong result: %s!!\n", s);
X      exit(1);
X    }
X    exit(0);
X  }
X
END_OF_FILE
if test 1471 -ne `wc -c <'ufc.c'`; then
    echo shar: \"'ufc.c'\" unpacked with wrong size!
fi
# end of 'ufc.c'
fi
echo shar: End of archive 1 \(of 2\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked both archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
