BABYL OPTIONS: Version: 5 Labels: Note: This is the header of an rmail file. Note: If you are seeing it in rmail, Note: it means the file has no messages in it.  0, unseen,, *** EOOH *** From: glad@daimi.aau.dk (Michael Glad) Newsgroups: comp.sources.misc Subject: v28i115: ufc-crypt - fast crypt/fcrypt routines, Part01/02 Date: 18 Mar 92 14:40:26 GMT Sender: aem@aber.ac.uk (Alec David Muffett) Followup-To: comp.sources.d Organization: University College of Wales, Aberystwyth Approved: aem@aber.ac.uk X-Md4-Signature: 25d5371029a264648b777c8183ca3793 Submitted-by: glad@daimi.aau.dk (Michael Glad) Posting-number: Volume 28, Issue 115 Archive-name: ufc-crypt/part01 Environment: UNIX, 32BIT Supersedes: ufc-crypt: Volume 23, 97-98 This is patchlevel 1 of my optimized crypt/fcrypt routines. Its a complete rerelease as a patchfile would be quite large. It is to replace all earlier releases of ufc and ufc-crypt. Features: * crypt(3)/fcrypt compatible library * works on 32/64 bit UNIX systems * on most machines offers a speedup in the range of 30-60 relative to the native crypt implementation in libc.a. * easy integration with release 4.1 and later of Alec Muffets Crack program. New features of this release: * performance improvements on some architectures, e.g. SUN SPARC. * setkey/encrypt routines added - now offering full crypt(3) functionality. * added validation/benchmarking programs. * memory demands reduced - now uses 160kb for tables. * support for 64 bit machines added - tested on Convex/Cray machines. UFC-crypt has been donated to the Free Software Foundation. It is still covered by the Gnu library license, version 2. -- Michael #! /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 'Makefile' <<'END_OF_FILE' X# X# UFC-crypt: ultra fast crypt(3) implementation X# Copyright (C) 1991, 1992, Free Software Foundation, Inc. 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.17 03/02/92 X# X XSHELL = /bin/sh X X# X# Select one of the following modules: X# X# You're advised to do a 'make clean' if X# you change this to ensure you get the X# proper routine linked into your program 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# NeXT 68k systems: crypt.next68.o X X# X# Which compiler & optimization flags to use X# XCC = cc XOFLAGS = -O 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 @./do_ranlib X# X# Additional tagets making variants of libufc.a X# using machine dependent assembly code. Intended X# for possible future use by 'Crack' X# Xlibufc.sparc.a: $(CRYPTOBJ) crypt.sparc.o X make CRYPT=crypt.sparc.o libufc.a ufc X cp libufc.a libufc.sparc.a X ranlib libufc.sparc.a Xlibufc.sun3.a: $(CRYPTOBJ) crypt.sun3.o X make CRYPT=crypt.sun3.o libufc.a ufc X cp libufc.a libufc.sun3.a X ranlib libufc.sun3.a Xlibufc.s300.a: $(CRYPTOBJ) crypt.s300.o X make CRYPT=crypt.s300.o libufc.a ufc X cp libufc.a libufc.s300.a Xlibufc.next68.a: $(CRYPTOBJ) crypt.next68.o X make CRYPT=crypt.next68.o libufc.a ufc X cp libufc.a libufc.next68.a X ranlib libufc.next68.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 X# NeXT 68k machines - thanks to korz.cs.columbia.edu (Fred Korz) Xcrypt.next68.o: crypt.next68.S X ./S2o crypt.next68.S crypt.next68.o Xcrypt.next68.S: crypt.sun3.S X sed -e '/\.proc/ d' crypt.sun3.S > crypt.next68.S X Xclean: X /bin/rm -f *.o core *~ ufc libufc*.a speedf speedc tmp.s mon.out cert \ X a.out Part* crypt.next68.S 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 do_ranlib END_OF_FILE if test 3475 -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'\" \(6314 characters\) sed "s/^X//" >'README' <<'END_OF_FILE' X X X UFC-crypt: ultra fast 'crypt' implementation X ============================================ X X @(#)README 2.14 3/6/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- On most machines, UFC-crypt runs 30-60 times faster than crypt(3) when X invoked repeated times with the same salt and varying passwords. X X- With mostly constant salts, performance is about two to 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, Cray, X Pyramid and IBM RS/6000 systems as well as with gcc on IBM PS/2(DOS) X and Linux on a 386 PC. X X- Requires 165 kb for tables. X X- UFC-crypt is known to have compilation problems on some micro computer X C compilers (e.g. Turbo C++) due to its table sizes. Flame the vendors X for placing arbitrary limitations on their products. Use & support the X GNU C compiler, gcc. X XAuthor & licensing etc X---------------------- X XUFC-crypt is created by Michael Glad, email: glad@daimi.aau.dk, and has Xbeen donated to the Free Software Foundation, Inc. It is covered by the XGNU 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. Compilation of the 'speed*' programs Xmay also fail as they use timer facilities not present in the same form Xin all UNIX implementations. 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 march 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 6314 -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'\" \(963 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, Free Software Foundation, Inc. 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.7 02/15/92 X# X# Preprocessor compiling .S files into .o files X# X X/lib/cpp -P $1 | tr \; '\012' > ./tmp.s Xas -o $2 ./tmp.s END_OF_FILE if test 963 -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'\" \(1438 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 * @(#)cert.c 1.5 02/08/92 X */ X X#include 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 1438 -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'\" \(3197 characters\) sed "s/^X//" >'crypt.c' <<'END_OF_FILE' X/* X * UFC-crypt: ultra fast crypt(3) implementation X * X * Copyright (C) 1991, 1992, Free Software Foundation, Inc. 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.17 2/22/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#define SBA(sb, v) (*(long64*)((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 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 3197 -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'\" \(2385 characters\) sed "s/^X//" >'crypt.s300.S' <<'END_OF_FILE' X # X # UFC-crypt: ultra fast crypt(3) implementation X # Copyright (C) 1991, 1992, Free Software Foundation, Inc. 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.8 02/15/92 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 data X byte "UFC-crypt crypt.sun3.S, @(#)crypt.s300.S 2.8 02/15/92\0" X even 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 2385 -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'\" \(2603 characters\) sed "s/^X//" >'crypt.sparc.S' <<'END_OF_FILE' X! X! UFC-crypt: ultra fast crypt(3) implementation X! Copyright (C) 1991, 1992, Free Software Foundation, Inc. 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.8 2/15/92 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 "data" X .ascii "UFC-crypt crypt.sparc.S, @(#)crypt.sparc.S 2.8 2/15/92\0" X .align 4 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 2603 -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'\" \(2367 characters\) sed "s/^X//" >'crypt.sun3.S' <<'END_OF_FILE' X| X| UFC-crypt: ultra fast crypt(3) implementation X| Copyright (C) 1991, 1992, Free Software Foundation, Inc. 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.12 2/15/92 X| X| Assembly code for SUN3 68000 based workstations. X| crypt.next68.S is generated automatically on basis of this module 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 .data X .ascii "UFC-crypt crypt.sun3.S, @(#)crypt.sun3.S 2.12 2/15/92\0" X .even 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 2367 -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 'do_ranlib' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'do_ranlib'\" else echo shar: Extracting \"'do_ranlib'\" \(1082 characters\) sed "s/^X//" >'do_ranlib' <<'END_OF_FILE' X#!/bin/sh X X# UFC-crypt: ultra fast crypt(3) implementation X# Copyright (C) 1991, 1992, Free Software Foundation, Inc. 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# @(#)do_ranlib 1.2 02/12/92 X# X# Frontend to the ranlib command X# X Xif [ -f /bin/ranlib -o -f /usr/bin/ranlib -o -f /usr/ucb/ranlib ] Xthen X echo ranlib libufc.a X ranlib libufc.a Xelse X echo "Couldn't find a ranlib command - skipping ranlib" Xfi X Xexit 0 END_OF_FILE if test 1082 -ne `wc -c <'do_ranlib'`; then echo shar: \"'do_ranlib'\" unpacked with wrong size! fi chmod +x 'do_ranlib' # end of 'do_ranlib' 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'\" \(959 characters\) sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE' X/* X * UFC-crypt: ultra fast crypt(3) implementation X * X * Copyright (C) 1991, 1992, Free Software Foundation, Inc. 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.9 03/02/92 X * X */ X X#define PATCHLEVEL "UFC-crypt, patchlevel 1c, @(#)patchlevel.h 1.9 03/02/92" END_OF_FILE if test 959 -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'\" \(1245 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 * @(#)speeds.c 1.6 02/08/92 X */ X X#include X#include X#include 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 1245 -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'\" \(2183 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, Free Software Foundation, Inc. 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.13 2/22/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/* thanks to (Tom Hutton) for testing */ 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 2183 -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'\" \(1463 characters\) sed "s/^X//" >'ufc.c' <<'END_OF_FILE' X/* X * UFC-crypt: ultra fast crypt(3) implementation X * X * Copyright (C) 1991, 1992, Free Software Foundation, Inc. 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.5 02/08/92 X * X * Stub main program for debugging X * and benchmarking. X * X */ X X#include 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