home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume23 / ufc-crypt / part02 < prev    next >
Text File  |  1991-10-21  |  18KB  |  668 lines

  1. Newsgroups: comp.sources.misc
  2. From: glad@daimi.aau.dk (Michael Glad)
  3. Subject:  v23i098:  ufc-crypt - fast crypt/fcrypt routines, Part02/02
  4. Message-ID: <1991Oct22.020049.29227@sparky.imd.sterling.com>
  5. X-Md4-Signature: 6e5cc8382ede05bd57174cd24db28617
  6. Date: Tue, 22 Oct 1991 02:00:49 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: glad@daimi.aau.dk (Michael Glad)
  10. Posting-number: Volume 23, Issue 98
  11. Archive-name: ufc-crypt/part02
  12. Environment: UNIX, 32BIT
  13.  
  14. #! /bin/sh
  15. # into a shell via "sh file" or similar.  To overwrite existing files,
  16. # type "sh file -c".
  17. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  18. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  19. # Contents:  Makefile crypt.c crypt.s300.S crypt.sparc.S crypt.sun3.S
  20. #   patchlevel.h ufc.c
  21. # Wrapped by kent@sparky on Wed Oct 16 15:47:03 1991
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. echo If this archive is complete, you will see the following message:
  24. echo '          "shar: End of archive 2 (of 2)."'
  25. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'Makefile'\"
  27. else
  28.   echo shar: Extracting \"'Makefile'\" \(1984 characters\)
  29.   sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  30. X#
  31. X# UFC-crypt: ultra fast crypt(3) implementation
  32. X# Copyright (C) 1991, Michael Glad, email: glad@daimi.aau.dk
  33. X#
  34. X# This library is free software; you can redistribute it and/or
  35. X# modify it under the terms of the GNU Library General Public
  36. X# License as published by the Free Software Foundation; either
  37. X# version 2 of the License, or (at your option) any later version.
  38. X#
  39. X# This library is distributed in the hope that it will be useful,
  40. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  41. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  42. X# Library General Public License for more details.
  43. X#
  44. X# You should have received a copy of the GNU Library General Public
  45. X# License along with this library; if not, write to the Free
  46. X# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  47. X#
  48. X# @(#)Makefile    2.2 10/04/91
  49. X#
  50. X
  51. X#
  52. X# Select one of the following modules:
  53. X#
  54. XCRYPT = crypt.o
  55. X
  56. X# portable C version: crypt.o
  57. X# SUN3 models:        crypt.sun3.o
  58. X# HP series 300/400:  crypt.s300.o
  59. X# SUN SPARC systems:  crypt.sparc.o
  60. X
  61. X#
  62. X# Which compiler to use
  63. X#
  64. X#CC = gcc
  65. XCC = cc
  66. X
  67. X# On HP's etc: define this
  68. XFL     = -DSYSV
  69. XOFLAGS = -O
  70. X
  71. X#
  72. X# End-of-configuration
  73. X#
  74. X
  75. XCFLAGS   = $(OFLAGS) $(FL)
  76. XCRYPTOBJ = crypt_util.o $(CRYPT)
  77. X
  78. X#
  79. X# Sample program for debugging/testing/benchmarking
  80. X#
  81. X
  82. Xufc: ufc.o libufc.a
  83. X    $(CC) ufc.o libufc.a -o ufc
  84. X
  85. Xlibufc.a: $(CRYPTOBJ)
  86. X    ar r libufc.a $(CRYPTOBJ)
  87. X    ranlib libufc.a
  88. X
  89. X#
  90. X# Crypt utility functions
  91. X#
  92. X
  93. Xcrypt_util.o: crypt_util.c
  94. Xufc.o: ufc.c
  95. X
  96. X#
  97. X# Crypt functions
  98. X#
  99. X
  100. X# Semiportable
  101. Xufc.o: ufc.c
  102. X    $(CC) $(CFLAGS) -c ufc.c
  103. X
  104. X# Sun3 
  105. Xcrypt.sun3.o: crypt.sun3.S
  106. X    ./S2o crypt.sun3.S crypt.sun3.o
  107. X
  108. X# HP 9000 series 300
  109. Xcrypt.s300.o: crypt.s300.S
  110. X    ./S2o crypt.s300.S crypt.s300.o
  111. X
  112. X# SUN SPARC architecture
  113. Xcrypt.sparc.o: crypt.sparc.S
  114. X    ./S2o crypt.sparc.S crypt.sparc.o
  115. X
  116. Xclean:
  117. X    /bin/rm -f *.o core *~ ufc libufc.a tmp.s mon.out a.out ufc.shar
  118. X
  119. Xshar:
  120. X    shar -c -pX COPYING README Makefile S2o crypt.c *.S crypt_util.c ufc.c patchlevel.h > ufc.shar
  121. END_OF_FILE
  122.   if test 1984 -ne `wc -c <'Makefile'`; then
  123.     echo shar: \"'Makefile'\" unpacked with wrong size!
  124.   fi
  125.   # end of 'Makefile'
  126. fi
  127. if test -f 'crypt.c' -a "${1}" != "-c" ; then 
  128.   echo shar: Will not clobber existing file \"'crypt.c'\"
  129. else
  130.   echo shar: Extracting \"'crypt.c'\" \(1957 characters\)
  131.   sed "s/^X//" >'crypt.c' <<'END_OF_FILE'
  132. X/*
  133. X * UFC-crypt: ultra fast crypt(3) implementation
  134. X *
  135. X * Copyright (C) 1991, Michael Glad, email: glad@daimi.aau.dk
  136. X *
  137. X * This library is free software; you can redistribute it and/or
  138. X * modify it under the terms of the GNU Library General Public
  139. X * License as published by the Free Software Foundation; either
  140. X * version 2 of the License, or (at your option) any later version.
  141. X *
  142. X * This library is distributed in the hope that it will be useful,
  143. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  144. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  145. X * Library General Public License for more details.
  146. X * You should have received a copy of the GNU Library General Public
  147. X * License along with this library; if not, write to the Free
  148. X * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  149. X *
  150. X * @(#)crypt.c    2.2 10/04/91
  151. X *
  152. X * Semiportable C version
  153. X *
  154. X */
  155. X
  156. Xextern void setup_salt(), mk_keytab(), pr_bits();
  157. Xextern char *output_conversion();
  158. X
  159. Xextern unsigned long sb0[], sb1[], sb2[], sb3[];
  160. Xextern unsigned long keytab[16][2];
  161. X
  162. X#define SBA(sb, v) (*(unsigned long*)((char*)(sb)+(v)))
  163. X
  164. X#define F(I, O1, O2, SBX, SBY)                                        \
  165. X    s = *k++ ^ I;                                                     \
  166. X    O1 ^= SBA(SBX, (s & 0xffff)); O2 ^= SBA(SBX, ((s & 0xffff) + 4)); \
  167. X    O1 ^= SBA(SBY, (s >>= 16));   O2 ^= SBA(SBY, ((s)          + 4));
  168. X
  169. X#define G(I1, I2, O1, O2)                                             \
  170. X        F(I1, O1, O2, sb1, sb0) F(I2, O1, O2, sb3, sb2)
  171. X
  172. X#define H G(r1, r2, l1, l2) ; G(l1, l2, r1, r2)
  173. X
  174. Xchar *crypt(key, salt)
  175. X  char *key;
  176. X  char *salt;
  177. X  { unsigned long l1, l2, r1, r2, i, j, s, *k;
  178. X
  179. X    setup_salt(salt);
  180. X    mk_keytab(key);
  181. X
  182. X    l1=l2=r1=r2=0;
  183. X
  184. X    for(j=0; j<25; j++) {
  185. X      k = &keytab[0][0];
  186. X      for(i=8; i--; ) {
  187. X    H;
  188. X      }
  189. X      s=l1; l1=r1; r1=s; s=l2; l2=r2; r2=s;
  190. X    }
  191. X
  192. X    return output_conversion(l1, l2, r1, r2, salt);
  193. X  }
  194. X
  195. END_OF_FILE
  196.   if test 1957 -ne `wc -c <'crypt.c'`; then
  197.     echo shar: \"'crypt.c'\" unpacked with wrong size!
  198.   fi
  199.   # end of 'crypt.c'
  200. fi
  201. if test -f 'crypt.s300.S' -a "${1}" != "-c" ; then 
  202.   echo shar: Will not clobber existing file \"'crypt.s300.S'\"
  203. else
  204.   echo shar: Extracting \"'crypt.s300.S'\" \(2491 characters\)
  205.   sed "s/^X//" >'crypt.s300.S' <<'END_OF_FILE'
  206. X #
  207. X # UFC-crypt: ultra fast crypt(3) implementation
  208. X # Copyright (C) 1991, Michael Glad, email: glad@daimi.aau.dk
  209. X #
  210. X # This library is free software, you can redistribute it and/or
  211. X # modify it under the terms of the GNU Library General Public
  212. X # License as published by the Free Software Foundation, either
  213. X # version 2 of the License, or (at your option) any later version.
  214. X #
  215. X # This library is distributed in the hope that it will be useful,
  216. X # but WITHOUT ANY WARRANTY, without even the implied warranty of
  217. X # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  218. X # Library General Public License for more details.
  219. X #
  220. X # You should have received a copy of the GNU Library General Public
  221. X # License along with this library, if not, write to the Free
  222. X # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  223. X #
  224. X # @(#)crypt.s300.S    2.2 10/04/91
  225. X #
  226. X # MC680x0/Hp9000 s300/s400 assembly code
  227. X #
  228. X
  229. X#define L1    %d0
  230. X#define L2    %d1
  231. X#define R1    %d2
  232. X#define R2    %d3
  233. X#define SCR1    %d4
  234. X#define SCR2    %d5
  235. X#define SCR3    %d6
  236. X
  237. X#define I    %d7
  238. X#define J    -16(%a6)
  239. X
  240. X#define SB0    %a0
  241. X#define SB1    %a1
  242. X#define SB2    %a2
  243. X#define SB3    %a3
  244. X#define KPTR    %a4
  245. X    
  246. X#define F(I,O1,O2,SBX,SBY)                        \
  247. X    mov.l     (KPTR)+,SCR1 ;        eor.l     I,SCR1 ;        \
  248. X    mov.l    0(SBX,SCR1.w),SCR2 ;     eor.l    SCR2,O1 ;        \
  249. X    mov.l    4(SBX,SCR1.w),SCR2 ;    eor.l    SCR2,O2 ;        \
  250. X    swap.w    SCR1 ;                            \
  251. X    mov.l    0(SBY,SCR1.w),SCR2 ;    eor.l    SCR2,O1 ;        \
  252. X    mov.l    4(SBY,SCR1.w),SCR2 ;    eor.l    SCR2,O2 ;
  253. X
  254. X#define G(I1,I2,O1,O2)            \
  255. X    F(I1,O1,O2,SB1,SB0) F(I2,O1,O2,SB3,SB2)
  256. X
  257. X#define H G(R1,R2,L1,L2) ; G(L1,L2,R1,R2)
  258. X
  259. X    text
  260. X    global _crypt
  261. X_crypt:
  262. X #
  263. X # Preamble
  264. X #
  265. X    link %a6,&-56 ; movem.l &15612,(%sp)
  266. X #
  267. X # Set up salt and key tables
  268. X #
  269. X    mov.l     0xc(%a6),-(%sp) ; jsr     _setup_salt ; addq.w     &4,%sp
  270. X    mov.l     0x8(%a6),-(%sp) ; jsr     _mk_keytab  ; addq.w     &4,%sp
  271. X #
  272. X # Setup address registers with sb pointers
  273. X #
  274. X    mov.l    &_sb0,SB0 ; mov.l &_sb1,SB1 ; mov.l &_sb2,SB2 ; mov.l &_sb3,SB3
  275. X # 
  276. X # Initialize DES working variables
  277. X #
  278. X    moveq    &0,L1 ; moveq &0,L2 ; moveq &0,R1 ; moveq &0,R2
  279. X
  280. X #
  281. X # And loop...
  282. X #
  283. X    mov.l    &25,J
  284. XLagain:    
  285. X    mov.l    &_keytab,KPTR
  286. X    moveq    &4,I
  287. XLagain1:
  288. X    H H
  289. X    subq.l    &1,I
  290. X    bne    Lagain1
  291. X # Permute
  292. X    mov.l L1,SCR1 ; mov.l R1,L1 ; mov.l SCR1,R1
  293. X    mov.l L2,SCR1 ; mov.l R2,L2 ; mov.l SCR1,R2
  294. X #
  295. X    subq.l    &1,J
  296. X    tst.l    J
  297. X    bne    Lagain
  298. X #
  299. X # Output conversion
  300. X #
  301. X    mov.l 0xc(%a6),-(%sp)
  302. X    mov.l R2,-(%sp) ; mov.l R1,-(%sp) ; mov.l L2,-(%sp) ; mov.l L1,-(%sp)
  303. X    jsr _output_conversion ; addq.w &4,%sp
  304. X
  305. X #
  306. X # Postamble
  307. X #
  308. X    movem.l    (-56)(%a6),&15612 ; unlk %a6 ; rts
  309. END_OF_FILE
  310.   if test 2491 -ne `wc -c <'crypt.s300.S'`; then
  311.     echo shar: \"'crypt.s300.S'\" unpacked with wrong size!
  312.   fi
  313.   # end of 'crypt.s300.S'
  314. fi
  315. if test -f 'crypt.sparc.S' -a "${1}" != "-c" ; then 
  316.   echo shar: Will not clobber existing file \"'crypt.sparc.S'\"
  317. else
  318.   echo shar: Extracting \"'crypt.sparc.S'\" \(2735 characters\)
  319.   sed "s/^X//" >'crypt.sparc.S' <<'END_OF_FILE'
  320. X!
  321. X! UFC-crypt: ultra fast crypt(3) implementation
  322. X! Copyright (C) 1991, Michael Glad, email: glad@daimi.aau.dk
  323. X!
  324. X! This library is free software, you can redistribute it and/or
  325. X! modify it under the terms of the GNU Library General Public
  326. X! License as published by the Free Software Foundation, either
  327. X! version 2 of the License, or (at your option) any later version.
  328. X!
  329. X! This library is distributed in the hope that it will be useful,
  330. X! but WITHOUT ANY WARRANTY, without even the implied warranty of
  331. X! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  332. X! Library General Public License for more details.
  333. X!
  334. X! You should have received a copy of the GNU Library General Public
  335. X! License along with this library, if not, write to the Free
  336. X! Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  337. X!
  338. X! @(#)crypt.sparc.S    2.2 10/04/91
  339. X!
  340. X! Assembly code for SPARC architecture machines
  341. X!
  342. X
  343. X#define J    %i2
  344. X#define I    %i3
  345. X#define SALT    %i4
  346. X#define KEY    %i5
  347. X
  348. X#define L1    %o0
  349. X#define L2    %o1
  350. X#define R1    %o2
  351. X#define R2    %o3
  352. X
  353. X#define KPTR    %g1
  354. X#define MASK    %g2
  355. X#define SCR1a    %g3
  356. X#define SCR1b    %g4
  357. X#define SCR1    %g5
  358. X#define SCR2    %g6
  359. X#define SCR3    %g7
  360. X
  361. X#define SB0a    %l0
  362. X#define SB0b    %l1
  363. X#define SB1a    %l2
  364. X#define SB1b    %l3
  365. X#define SB2a    %l4
  366. X#define SB2b    %l5
  367. X#define SB3a    %l6
  368. X#define SB3b    %l7
  369. X
  370. X#define ASSIGN(reg,value) sethi %hi(value),reg ; or %lo(value),reg,reg ;
  371. X
  372. X
  373. X#define F(I,O1,O2,SBX1,SBX2,SBY1,SBY2)                \
  374. X    ld     [KPTR],SCR1 ;                    \
  375. X    xor    SCR1,I,SCR1 ;                     \
  376. X     and    SCR1,MASK,SCR1a ;                \
  377. X                                \
  378. X    ld    [SBX1+SCR1a],SCR2 ;    inc    4,KPTR ;    \
  379. X     srl    SCR1,16,SCR1b ;                    \
  380. X    ld    [SBX2+SCR1a],SCR3 ;    xor    SCR2,O1,O1 ;    \
  381. X                                \
  382. X    ld    [SBY1+SCR1b],SCR2 ;    xor     SCR3,O2,O2 ;    \
  383. X    ld    [SBY2+SCR1b],SCR3 ;    xor     SCR2,O1,O1 ;    \
  384. X                                \
  385. X    xor     SCR3,O2,O2 ;
  386. X
  387. X#define G(I1,I2,O1,O2)            \
  388. X    F(I1,O1,O2,SB1a,SB1b,SB0a,SB0b) F(I2,O1,O2,SB3a,SB3b,SB2a,SB2b)
  389. X
  390. X#define H G(R1,R2,L1,L2) ; G(L1,L2,R1,R2)
  391. X
  392. X    .seg    "text"
  393. X    .global    _crypt
  394. X
  395. X_crypt:
  396. X!
  397. X! Preamble
  398. X!
  399. X    save    %sp,-104,%sp
  400. X!
  401. X! Set up salt and key tables
  402. X!
  403. X    mov    %i0,KEY     ; mov %i1,SALT
  404. X        call    _setup_salt,1     ; mov SALT,%o0 ! delayed branch!
  405. X    call    _mk_keytab,1      ; mov KEY,%o0  ! do
  406. X!
  407. X! Set up sb pointers
  408. X!
  409. X    ASSIGN(SB0a,_sb0) ; add SB0a,4,SB0b
  410. X    ASSIGN(SB1a,_sb1) ; add SB1a,4,SB1b 
  411. X    ASSIGN(SB2a,_sb2) ; add SB2a,4,SB2b
  412. X    ASSIGN(SB3a,_sb3) ; add SB3a,4,SB3b
  413. X!
  414. X    ASSIGN(MASK,0xffff)
  415. X!
  416. X! Initialize working variables
  417. X!
  418. X    mov    0,L1 ; mov 0,L2 ; mov 0,R1 ; mov 0,R2
  419. X!
  420. X! And loop...
  421. X!
  422. X    
  423. X    ASSIGN(J,25)
  424. XLagain:
  425. X    ASSIGN(KPTR,_keytab)
  426. X    ASSIGN(I, 8)
  427. XLagain1:
  428. X    H
  429. X    deccc    I
  430. X    bnz     Lagain1
  431. X    nop
  432. X! Permute
  433. X    mov L1,SCR1 ; mov R1,L1 ; mov SCR1,R1
  434. X    mov L2,SCR1 ; mov R2,L2 ; mov SCR1,R2
  435. X!
  436. X    deccc     J
  437. X    bnz     Lagain
  438. X    nop
  439. X!
  440. X! Output conversion
  441. X!
  442. X    call    _output_conversion,5
  443. X    mov    SALT,%o4
  444. X!
  445. X! Postamble
  446. X!
  447. X    ret ; restore %g0,%o0,%o0
  448. END_OF_FILE
  449.   if test 2735 -ne `wc -c <'crypt.sparc.S'`; then
  450.     echo shar: \"'crypt.sparc.S'\" unpacked with wrong size!
  451.   fi
  452.   # end of 'crypt.sparc.S'
  453. fi
  454. if test -f 'crypt.sun3.S' -a "${1}" != "-c" ; then 
  455.   echo shar: Will not clobber existing file \"'crypt.sun3.S'\"
  456. else
  457.   echo shar: Extracting \"'crypt.sun3.S'\" \(2388 characters\)
  458.   sed "s/^X//" >'crypt.sun3.S' <<'END_OF_FILE'
  459. X|
  460. X| UFC-crypt: ultra fast crypt(3) implementation
  461. X| Copyright (C) 1991, Michael Glad, email: glad@daimi.aau.dk
  462. X|
  463. X| This library is free software, you can redistribute it and/or
  464. X| modify it under the terms of the GNU Library General Public
  465. X| License as published by the Free Software Foundation, either
  466. X| version 2 of the License, or (at your option) any later version.
  467. X|
  468. X| This library is distributed in the hope that it will be useful,
  469. X| but WITHOUT ANY WARRANTY, without even the implied warranty of
  470. X| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  471. X| Library General Public License for more details.
  472. X|
  473. X| You should have received a copy of the GNU Library General Public
  474. X| License along with this library, if not, write to the Free
  475. X| Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  476. X|
  477. X| @(#)crypt.sun3.S    2.2 10/04/91
  478. X|
  479. X| Assembly code for SUN3 models
  480. X|
  481. X
  482. X#define L1    d0
  483. X#define L2    d1
  484. X#define R1    d2
  485. X#define R2    d3
  486. X#define SCR1    d4
  487. X#define SCR2    d5
  488. X#define SCR3    d6
  489. X
  490. X#define I       d7
  491. X#define J    a6@(-16)
  492. X
  493. X#define SB0    a0
  494. X#define SB1    a1
  495. X#define SB2    a2
  496. X#define SB3    a3
  497. X#define KPTR    a4
  498. X    
  499. X#define F(I,O1,O2,SBX,SBY)                        \
  500. X    movl     KPTR@+,SCR1 ;        eorl     I,SCR1 ;        \
  501. X    movl    SBX@(0,SCR1:w),SCR2 ;     eorl    SCR2,O1 ;        \
  502. X    movl    SBX@(4,SCR1:w),SCR2 ;    eorl    SCR2,O2 ;        \
  503. X    swap    SCR1 ;                            \
  504. X    movl    SBY@(0,SCR1:w),SCR2 ;    eorl    SCR2,O1 ;        \
  505. X    movl    SBY@(4,SCR1:w),SCR2 ;    eorl    SCR2,O2 ;
  506. X
  507. X#define G(I1,I2,O1,O2)            \
  508. X    F(I1,O1,O2,SB1,SB0) F(I2,O1,O2,SB3,SB2)
  509. X
  510. X#define H G(R1,R2,L1,L2) ; G(L1,L2,R1,R2)
  511. X
  512. X    .text
  513. X    .proc
  514. X    .globl _crypt
  515. X_crypt:
  516. X|
  517. X| Preamble
  518. X|
  519. X    link a6,#-56 ; moveml #15612,sp@
  520. X|
  521. X| Set up salt and key tables
  522. X|
  523. X    movl     a6@(0xc),sp@-    ; jbsr     _setup_salt ; addqw     #4,sp
  524. X    movl     a6@(0x8),sp@-    ; jbsr     _mk_keytab  ; addqw     #4,sp
  525. X|
  526. X| Setup address registers with sb pointers
  527. X|
  528. X    movl    #_sb0,SB0 ; movl #_sb1,SB1 ; movl #_sb2,SB2 ; movl #_sb3,SB3
  529. X| 
  530. X| Initialize DES working variables
  531. X|
  532. X    moveq    #0,L1 ; moveq #0,L2 ; moveq #0,R1 ; moveq #0,R2
  533. X
  534. X|
  535. X| And loop...
  536. X|
  537. X    movl #25,J
  538. XLagain:    
  539. X    movl  #_keytab,KPTR
  540. X    moveq #4,I
  541. XLagain1:
  542. X    H H
  543. X    subql #1,I
  544. X    tstl  I
  545. X    jne   Lagain1    
  546. X| Permute
  547. X    movl L1,SCR1 ; movl R1,L1 ; movl SCR1,R1
  548. X    movl L2,SCR1 ; movl R2,L2 ; movl SCR1,R2
  549. X|
  550. X    subql    #1,J
  551. X    jne    Lagain
  552. X|
  553. X| Output conversion
  554. X|
  555. X    movl a6@(0xc),sp@-
  556. X    movl R2,sp@- ; movl R1,sp@- ; movl L2,sp@- ; movl L1,sp@-
  557. X    jbsr _output_conversion ; addqw #4,sp
  558. X
  559. X|
  560. X| Postamble
  561. X|
  562. X    moveml     a6@(-56),#15612 ; unlk a6 ; rts
  563. END_OF_FILE
  564.   if test 2388 -ne `wc -c <'crypt.sun3.S'`; then
  565.     echo shar: \"'crypt.sun3.S'\" unpacked with wrong size!
  566.   fi
  567.   # end of 'crypt.sun3.S'
  568. fi
  569. if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  570.   echo shar: Will not clobber existing file \"'patchlevel.h'\"
  571. else
  572.   echo shar: Extracting \"'patchlevel.h'\" \(57 characters\)
  573.   sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
  574. X/* @(#)patchlevel.h    1.1 10/04/91 */
  575. X#define PATCHLEVEL 0
  576. END_OF_FILE
  577.   if test 57 -ne `wc -c <'patchlevel.h'`; then
  578.     echo shar: \"'patchlevel.h'\" unpacked with wrong size!
  579.   fi
  580.   # end of 'patchlevel.h'
  581. fi
  582. if test -f 'ufc.c' -a "${1}" != "-c" ; then 
  583.   echo shar: Will not clobber existing file \"'ufc.c'\"
  584. else
  585.   echo shar: Extracting \"'ufc.c'\" \(1429 characters\)
  586.   sed "s/^X//" >'ufc.c' <<'END_OF_FILE'
  587. X/*
  588. X * UFC-crypt: ultra fast crypt(3) implementation
  589. X *
  590. X * Copyright (C) 1991, Michael Glad, email: glad@daimi.aau.dk
  591. X *
  592. X * This library is free software; you can redistribute it and/or
  593. X * modify it under the terms of the GNU Library General Public
  594. X * License as published by the Free Software Foundation; either
  595. X * version 2 of the License, or (at your option) any later version.
  596. X *
  597. X * This library is distributed in the hope that it will be useful,
  598. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  599. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  600. X * Library General Public License for more details.
  601. X * You should have received a copy of the GNU Library General Public
  602. X * License along with this library; if not, write to the Free
  603. X * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  604. X *
  605. X * @(#)ufc.c    2.2 10/04/91
  606. X *
  607. X * Stub main program for debugging
  608. X * and benchmarking.
  609. X *
  610. X */
  611. X
  612. X#include <stdio.h>
  613. X
  614. Xchar *crypt();
  615. X
  616. Xmain(argc, argv)
  617. X  int argc;
  618. X  char **argv;
  619. X  { char *s;
  620. X    unsigned long i,iterations;
  621. X
  622. X    if(argc != 2) {
  623. X      fprintf(stderr, "usage: ufc iterations\n");
  624. X      exit(1);
  625. X    }
  626. X    argv++;
  627. X    iterations = atoi(*argv);
  628. X    printf("ufc: running %d iterations\n", iterations);
  629. X
  630. X    for(i=0; i<iterations; i++)
  631. X      s=crypt("foob","ar");
  632. X    if(strcmp(s, "arlEKn0OzVJn.") == 0)
  633. X      printf("OK\n");
  634. X    else
  635. X      printf("wrong result: %s!!\n", s);
  636. X  }
  637. X
  638. END_OF_FILE
  639.   if test 1429 -ne `wc -c <'ufc.c'`; then
  640.     echo shar: \"'ufc.c'\" unpacked with wrong size!
  641.   fi
  642.   # end of 'ufc.c'
  643. fi
  644. echo shar: End of archive 2 \(of 2\).
  645. cp /dev/null ark2isdone
  646. MISSING=""
  647. for I in 1 2 ; do
  648.     if test ! -f ark${I}isdone ; then
  649.     MISSING="${MISSING} ${I}"
  650.     fi
  651. done
  652. if test "${MISSING}" = "" ; then
  653.     echo You have unpacked both archives.
  654.     rm -f ark[1-9]isdone
  655. else
  656.     echo You still must unpack the following archives:
  657.     echo "        " ${MISSING}
  658. fi
  659. exit 0
  660. exit 0 # Just in case...
  661. -- 
  662. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  663. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  664. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  665. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  666.