home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / cbw / part05 < prev    next >
SHell self-extracting ARchive  |  1987-06-17  |  54.7 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: SHell self-extracting ARchive (archive/shar).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 73 65 | 69 73 6d 6f 21 75 75 6e |Path: se|ismo!uun|
|00000010| 65 74 21 72 73 0a 46 72 | 6f 6d 3a 20 72 73 40 75 |et!rs.Fr|om: rs@u|
|00000020| 75 6e 65 74 2e 55 55 2e | 4e 45 54 20 28 52 69 63 |unet.UU.|NET (Ric|
|00000030| 68 20 53 61 6c 7a 29 0a | 4e 65 77 73 67 72 6f 75 |h Salz).|Newsgrou|
|00000040| 70 73 3a 20 63 6f 6d 70 | 2e 73 6f 75 72 63 65 73 |ps: comp|.sources|
|00000050| 2e 75 6e 69 78 0a 53 75 | 62 6a 65 63 74 3a 20 76 |.unix.Su|bject: v|
|00000060| 31 30 69 30 30 35 3a 20 | 20 43 72 79 70 74 20 42 |10i005: | Crypt B|
|00000070| 72 65 61 6b 65 72 27 73 | 20 57 6f 72 6b 62 65 6e |reaker's| Workben|
|00000080| 63 68 2c 20 50 61 72 74 | 30 35 2f 31 31 0a 4d 65 |ch, Part|05/11.Me|
|00000090| 73 73 61 67 65 2d 49 44 | 3a 20 3c 33 38 37 40 75 |ssage-ID|: <387@u|
|000000a0| 75 6e 65 74 2e 55 55 2e | 4e 45 54 3e 0a 44 61 74 |unet.UU.|NET>.Dat|
|000000b0| 65 3a 20 31 39 20 4a 75 | 6e 20 38 37 20 30 33 3a |e: 19 Ju|n 87 03:|
|000000c0| 30 36 3a 31 30 20 47 4d | 54 0a 4f 72 67 61 6e 69 |06:10 GM|T.Organi|
|000000d0| 7a 61 74 69 6f 6e 3a 20 | 55 55 4e 45 54 20 43 6f |zation: |UUNET Co|
|000000e0| 6d 6d 75 6e 69 63 61 74 | 69 6f 6e 73 20 53 65 72 |mmunicat|ions Ser|
|000000f0| 76 69 63 65 73 2c 20 41 | 72 6c 69 6e 67 74 6f 6e |vices, A|rlington|
|00000100| 2c 20 56 41 0a 4c 69 6e | 65 73 3a 20 31 39 39 38 |, VA.Lin|es: 1998|
|00000110| 0a 41 70 70 72 6f 76 65 | 64 3a 20 72 73 40 75 75 |.Approve|d: rs@uu|
|00000120| 6e 65 74 2e 75 75 2e 6e | 65 74 0a 0a 53 75 62 6d |net.uu.n|et..Subm|
|00000130| 69 74 74 65 64 20 62 79 | 3a 20 52 6f 62 65 72 74 |itted by|: Robert|
|00000140| 20 57 2e 20 42 61 6c 64 | 77 69 6e 20 3c 42 41 4c | W. Bald|win <BAL|
|00000150| 44 57 49 4e 40 58 58 2e | 4c 43 53 2e 4d 49 54 2e |DWIN@XX.|LCS.MIT.|
|00000160| 45 44 55 3e 0a 4d 6f 64 | 2e 73 6f 75 72 63 65 73 |EDU>.Mod|.sources|
|00000170| 3a 20 56 6f 6c 75 6d 65 | 20 31 30 2c 20 49 73 73 |: Volume| 10, Iss|
|00000180| 75 65 20 35 0a 41 72 63 | 68 69 76 65 2d 6e 61 6d |ue 5.Arc|hive-nam|
|00000190| 65 3a 20 63 62 77 2f 50 | 61 72 74 30 35 0a 0a 23 |e: cbw/P|art05..#|
|000001a0| 21 20 2f 62 69 6e 2f 73 | 68 0a 23 20 54 68 69 73 |! /bin/s|h.# This|
|000001b0| 20 69 73 20 61 20 73 68 | 65 6c 6c 20 61 72 63 68 | is a sh|ell arch|
|000001c0| 69 76 65 2e 20 20 52 65 | 6d 6f 76 65 20 61 6e 79 |ive. Re|move any|
|000001d0| 74 68 69 6e 67 20 62 65 | 66 6f 72 65 20 74 68 69 |thing be|fore thi|
|000001e0| 73 20 6c 69 6e 65 2c 20 | 74 68 65 6e 20 75 6e 70 |s line, |then unp|
|000001f0| 61 63 6b 0a 23 20 69 74 | 20 62 79 20 73 61 76 69 |ack.# it| by savi|
|00000200| 6e 67 20 69 74 20 69 6e | 74 6f 20 61 20 66 69 6c |ng it in|to a fil|
|00000210| 65 20 61 6e 64 20 74 79 | 70 69 6e 67 20 22 73 68 |e and ty|ping "sh|
|00000220| 20 66 69 6c 65 22 2e 20 | 20 54 6f 20 6f 76 65 72 | file". | To over|
|00000230| 77 72 69 74 65 20 65 78 | 69 73 74 69 6e 67 0a 23 |write ex|isting.#|
|00000240| 20 66 69 6c 65 73 2c 20 | 74 79 70 65 20 22 73 68 | files, |type "sh|
|00000250| 20 66 69 6c 65 20 2d 63 | 22 2e 20 20 59 6f 75 20 | file -c|". You |
|00000260| 63 61 6e 20 61 6c 73 6f | 20 66 65 65 64 20 74 68 |can also| feed th|
|00000270| 69 73 20 61 73 20 73 74 | 61 6e 64 61 72 64 20 69 |is as st|andard i|
|00000280| 6e 70 75 74 20 76 69 61 | 0a 23 20 75 6e 73 68 61 |nput via|.# unsha|
|00000290| 72 2c 20 6f 72 20 62 79 | 20 74 79 70 69 6e 67 20 |r, or by| typing |
|000002a0| 22 73 68 20 3c 66 69 6c | 65 22 2c 20 65 2e 67 2e |"sh <fil|e", e.g.|
|000002b0| 2e 20 20 49 66 20 74 68 | 69 73 20 61 72 63 68 69 |. If th|is archi|
|000002c0| 76 65 20 69 73 20 63 6f | 6d 70 6c 65 74 65 2c 20 |ve is co|mplete, |
|000002d0| 79 6f 75 0a 23 20 77 69 | 6c 6c 20 73 65 65 20 74 |you.# wi|ll see t|
|000002e0| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 6d 65 73 |he follo|wing mes|
|000002f0| 73 61 67 65 20 61 74 20 | 74 68 65 20 65 6e 64 3a |sage at |the end:|
|00000300| 0a 23 09 09 22 45 6e 64 | 20 6f 66 20 61 72 63 68 |.#.."End| of arch|
|00000310| 69 76 65 20 35 20 28 6f | 66 20 31 31 29 2e 22 0a |ive 5 (o|f 11).".|
|00000320| 23 20 43 6f 6e 74 65 6e | 74 73 3a 20 20 52 65 61 |# Conten|ts: Rea|
|00000330| 64 2e 6d 65 20 63 69 70 | 68 65 72 2e 63 20 65 63 |d.me cip|her.c ec|
|00000340| 6c 61 73 73 2e 63 20 6b | 6e 69 74 2e 63 20 7a 65 |lass.c k|nit.c ze|
|00000350| 65 63 6f 64 65 2e 70 65 | 72 6d 0a 23 20 57 72 61 |ecode.pe|rm.# Wra|
|00000360| 70 70 65 64 20 62 79 20 | 72 73 40 75 75 6e 65 74 |pped by |rs@uunet|
|00000370| 20 6f 6e 20 57 65 64 20 | 4a 75 6e 20 31 37 20 31 | on Wed |Jun 17 1|
|00000380| 38 3a 31 37 3a 31 37 20 | 31 39 38 37 0a 50 41 54 |8:17:17 |1987.PAT|
|00000390| 48 3d 2f 62 69 6e 3a 2f | 75 73 72 2f 62 69 6e 3a |H=/bin:/|usr/bin:|
|000003a0| 2f 75 73 72 2f 75 63 62 | 20 3b 20 65 78 70 6f 72 |/usr/ucb| ; expor|
|000003b0| 74 20 50 41 54 48 0a 69 | 66 20 74 65 73 74 20 2d |t PATH.i|f test -|
|000003c0| 66 20 52 65 61 64 2e 6d | 65 20 2d 61 20 22 24 7b |f Read.m|e -a "${|
|000003d0| 31 7d 22 20 21 3d 20 22 | 2d 63 22 20 3b 20 74 68 |1}" != "|-c" ; th|
|000003e0| 65 6e 20 0a 20 20 65 63 | 68 6f 20 73 68 61 72 3a |en . ec|ho shar:|
|000003f0| 20 57 69 6c 6c 20 6e 6f | 74 20 6f 76 65 72 2d 77 | Will no|t over-w|
|00000400| 72 69 74 65 20 65 78 69 | 73 74 69 6e 67 20 66 69 |rite exi|sting fi|
|00000410| 6c 65 20 5c 22 52 65 61 | 64 2e 6d 65 5c 22 0a 65 |le \"Rea|d.me\".e|
|00000420| 6c 73 65 0a 65 63 68 6f | 20 73 68 61 72 3a 20 45 |lse.echo| shar: E|
|00000430| 78 74 72 61 63 74 69 6e | 67 20 5c 22 52 65 61 64 |xtractin|g \"Read|
|00000440| 2e 6d 65 5c 22 20 5c 28 | 39 37 39 33 20 63 68 61 |.me\" \(|9793 cha|
|00000450| 72 61 63 74 65 72 73 5c | 29 0a 73 65 64 20 22 73 |racters\|).sed "s|
|00000460| 2f 5e 58 2f 2f 22 20 3e | 52 65 61 64 2e 6d 65 20 |/^X//" >|Read.me |
|00000470| 3c 3c 27 45 4e 44 5f 4f | 46 5f 52 65 61 64 2e 6d |<<'END_O|F_Read.m|
|00000480| 65 27 0a 58 0a 58 55 4e | 50 41 43 4b 49 4e 47 20 |e'.X.XUN|PACKING |
|00000490| 4e 4f 54 45 53 20 5b 62 | 79 20 52 69 63 68 20 24 |NOTES [b|y Rich $|
|000004a0| 61 6c 7a 5d 0a 58 09 54 | 68 65 72 65 20 55 73 65 |alz].X.T|here Use|
|000004b0| 6e 65 74 20 64 69 73 74 | 72 69 62 75 74 69 6f 6e |net dist|ribution|
|000004c0| 20 6f 66 20 43 42 57 20 | 69 6e 63 6c 75 64 65 73 | of CBW |includes|
|000004d0| 20 73 69 78 20 66 69 6c | 65 73 20 74 68 61 74 20 | six fil|es that |
|000004e0| 68 61 76 65 0a 58 62 65 | 65 6e 20 55 55 45 4e 43 |have.Xbe|en UUENC|
|000004f0| 4f 44 45 27 64 20 62 65 | 63 61 75 73 65 20 74 68 |ODE'd be|cause th|
|00000500| 65 79 20 63 6f 6e 74 61 | 69 6e 20 6e 6f 6e 2d 70 |ey conta|in non-p|
|00000510| 72 69 6e 74 69 6e 67 20 | 63 68 61 72 61 63 74 65 |rinting |characte|
|00000520| 72 73 3a 0a 58 09 20 20 | 20 20 55 55 2e 66 6f 6f |rs:.X. | UU.foo|
|00000530| 20 55 55 2e 67 72 61 70 | 68 69 63 73 20 55 55 2e | UU.grap|hics UU.|
|00000540| 74 65 73 74 20 55 55 2e | 74 65 73 74 31 20 55 55 |test UU.|test1 UU|
|00000550| 2e 74 65 73 74 32 20 55 | 55 2e 74 65 73 74 33 0a |.test2 U|U.test3.|
|00000560| 58 59 6f 75 20 6d 75 73 | 74 20 66 69 72 73 74 20 |XYou mus|t first |
|00000570| 64 65 63 6f 64 65 20 74 | 68 65 73 65 20 66 69 6c |decode t|hese fil|
|00000580| 65 73 20 62 65 66 6f 72 | 65 20 75 73 69 6e 67 20 |es befor|e using |
|00000590| 74 68 65 6d 3b 20 6f 6e | 65 20 6f 66 0a 58 74 68 |them; on|e of.Xth|
|000005a0| 65 20 63 6f 6d 6d 61 6e | 64 20 73 65 74 73 20 77 |e comman|d sets w|
|000005b0| 69 6c 6c 20 64 6f 20 74 | 68 65 20 74 72 69 63 6b |ill do t|he trick|
|000005c0| 3a 0a 58 09 66 6f 72 20 | 49 20 69 6e 20 55 55 2e |:.X.for |I in UU.|
|000005d0| 2a 20 3b 20 64 6f 20 75 | 75 64 65 63 6f 64 65 20 |* ; do u|udecode |
|000005e0| 24 49 20 3b 20 64 6f 6e | 65 09 2d 2d 20 2f 62 69 |$I ; don|e.-- /bi|
|000005f0| 6e 2f 73 68 0a 58 09 66 | 6f 72 65 61 63 68 20 49 |n/sh.X.f|oreach I|
|00000600| 20 28 55 55 2e 2a 29 09 | 09 09 2d 2d 20 43 20 73 | (UU.*).|..-- C s|
|00000610| 68 65 6c 6c 0a 58 09 20 | 20 20 20 75 75 64 65 63 |hell.X. | uudec|
|00000620| 6f 64 65 20 24 49 09 09 | 09 09 2d 2d 0a 58 09 65 |ode $I..|..--.X.e|
|00000630| 6e 64 09 09 09 09 09 2d | 2d 0a 58 0a 58 09 54 68 |nd.....-|-.X.X.Th|
|00000640| 69 73 20 64 69 72 65 63 | 74 6f 72 79 20 63 6f 6e |is direc|tory con|
|00000650| 74 61 69 6e 73 20 74 68 | 65 20 73 6f 75 72 63 65 |tains th|e source|
|00000660| 2c 20 64 6f 63 75 6d 65 | 6e 74 61 74 69 6f 6e 2c |, docume|ntation,|
|00000670| 20 61 6e 64 0a 58 61 75 | 78 69 6c 61 72 79 20 66 | and.Xau|xilary f|
|00000680| 69 6c 65 73 20 66 6f 72 | 20 74 68 65 20 43 72 79 |iles for| the Cry|
|00000690| 70 74 20 42 72 65 61 6b | 65 72 73 20 57 6f 72 6b |pt Break|ers Work|
|000006a0| 62 65 6e 63 68 20 28 63 | 62 77 29 2e 20 20 43 42 |bench (c|bw). CB|
|000006b0| 57 20 69 73 0a 58 61 20 | 6d 75 6c 74 69 2d 77 69 |W is.Xa |multi-wi|
|000006c0| 6e 64 6f 77 20 69 6e 74 | 65 67 72 61 74 65 64 20 |ndow int|egrated |
|000006d0| 77 6f 72 6b 62 65 6e 63 | 68 20 6f 66 20 74 6f 6f |workbenc|h of too|
|000006e0| 6c 73 20 74 68 61 74 20 | 68 65 6c 70 20 61 20 63 |ls that |help a c|
|000006f0| 72 79 70 74 61 6e 61 6c | 69 73 74 0a 58 72 65 61 |ryptanal|ist.Xrea|
|00000700| 64 20 66 69 6c 65 73 20 | 65 6e 63 72 79 70 74 65 |d files |encrypte|
|00000710| 64 20 77 69 74 68 20 74 | 68 65 20 42 53 44 34 2e |d with t|he BSD4.|
|00000720| 32 20 63 72 79 70 74 20 | 63 6f 6d 6d 61 6e 64 2e |2 crypt |command.|
|00000730| 20 20 41 6e 79 6f 6e 65 | 0a 58 6d 61 79 20 63 6f | Anyone|.Xmay co|
|00000740| 70 79 2c 20 6d 6f 64 69 | 66 79 2c 20 75 73 65 2c |py, modi|fy, use,|
|00000750| 20 6f 72 20 72 65 64 69 | 73 74 72 69 62 75 74 65 | or redi|stribute|
|00000760| 20 74 68 69 73 20 73 79 | 73 74 65 6d 2e 20 20 49 | this sy|stem. I|
|00000770| 74 20 77 61 73 0a 58 6f | 72 69 67 69 6e 61 6c 6c |t was.Xo|riginall|
|00000780| 79 20 77 72 69 74 74 65 | 6e 20 62 79 20 52 6f 62 |y writte|n by Rob|
|00000790| 65 72 74 20 57 2e 20 42 | 61 6c 64 77 69 6e 20 61 |ert W. B|aldwin a|
|000007a0| 74 20 4d 49 54 2e 0a 58 | 0a 58 0a 58 47 45 54 54 |t MIT..X|.X.XGETT|
|000007b0| 49 4e 47 20 53 54 41 52 | 54 45 44 0a 58 0a 58 09 |ING STAR|TED.X.X.|
|000007c0| 41 20 75 73 65 72 27 73 | 20 6d 61 6e 75 61 6c 20 |A user's| manual |
|000007d0| 69 73 20 70 72 6f 76 69 | 64 65 64 20 69 6e 20 63 |is provi|ded in c|
|000007e0| 62 77 2e 64 6f 63 2e 20 | 20 54 68 65 20 73 63 72 |bw.doc. | The scr|
|000007f0| 69 62 65 20 73 6f 75 72 | 63 65 0a 58 66 6f 72 20 |ibe sour|ce.Xfor |
|00000800| 74 68 65 20 75 73 65 72 | 27 73 20 6d 61 6e 75 61 |the user|'s manua|
|00000810| 6c 20 69 73 20 69 6e 20 | 63 62 77 2e 6d 73 73 2e |l is in |cbw.mss.|
|00000820| 20 20 54 68 65 20 66 69 | 6c 65 20 49 6e 64 65 78 | The fi|le Index|
|00000830| 20 62 72 69 65 66 6c 79 | 20 64 65 73 63 72 69 62 | briefly| describ|
|00000840| 65 73 0a 58 74 68 65 20 | 76 61 72 69 6f 75 73 20 |es.Xthe |various |
|00000850| 70 72 6f 67 72 61 6d 73 | 20 69 6e 20 74 68 69 73 |programs| in this|
|00000860| 20 64 69 72 65 63 74 6f | 72 79 2e 0a 58 0a 58 09 | directo|ry..X.X.|
|00000870| 43 42 57 20 69 73 20 77 | 72 69 74 74 65 6e 20 69 |CBW is w|ritten i|
|00000880| 6e 20 43 20 61 6e 64 20 | 64 69 73 74 72 69 62 75 |n C and |distribu|
|00000890| 74 65 64 20 77 69 74 68 | 20 74 68 65 20 73 6f 75 |ted with| the sou|
|000008a0| 72 63 65 20 63 6f 64 65 | 20 74 6f 0a 58 65 6e 63 |rce code| to.Xenc|
|000008b0| 6f 75 72 61 67 65 20 70 | 65 6f 70 6c 65 20 74 6f |ourage p|eople to|
|000008c0| 20 70 6c 61 79 20 77 69 | 74 68 20 69 74 2e 20 20 | play wi|th it. |
|000008d0| 49 74 20 73 68 6f 75 6c | 64 20 72 75 6e 20 6f 6e |It shoul|d run on|
|000008e0| 20 61 6e 79 20 64 69 73 | 70 6c 61 79 0a 58 74 65 | any dis|play.Xte|
|000008f0| 72 6d 69 6e 61 6c 2e 20 | 20 52 65 61 64 20 74 68 |rminal. | Read th|
|00000900| 65 20 75 73 65 72 73 20 | 6d 61 6e 75 61 6c 20 66 |e users |manual f|
|00000910| 6f 72 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 6f |or infor|mation o|
|00000920| 6e 20 74 65 72 6d 69 6e | 61 6c 0a 58 63 6f 6d 70 |n termin|al.Xcomp|
|00000930| 61 74 69 62 69 6c 69 74 | 79 2e 0a 58 0a 58 0a 58 |atibilit|y..X.X.X|
|00000940| 09 0a 58 54 4f 20 43 4f | 4d 50 49 4c 45 20 43 42 |..XTO CO|MPILE CB|
|00000950| 57 0a 58 0a 58 09 45 78 | 65 63 75 74 65 20 22 6d |W.X.X.Ex|ecute "m|
|00000960| 61 6b 65 22 20 77 69 74 | 68 20 6e 6f 20 61 72 67 |ake" wit|h no arg|
|00000970| 75 6d 65 6e 74 73 2e 20 | 20 43 42 57 20 75 73 65 |uments. | CBW use|
|00000980| 73 20 72 6f 75 74 69 6e | 65 73 20 66 72 6f 6d 20 |s routin|es from |
|00000990| 74 68 65 20 74 65 72 6d | 63 61 70 0a 58 61 6e 64 |the term|cap.Xand|
|000009a0| 20 63 75 72 73 65 73 20 | 6c 69 62 72 61 72 69 65 | curses |librarie|
|000009b0| 73 2c 20 62 75 74 20 69 | 74 20 64 6f 65 73 20 6e |s, but i|t does n|
|000009c0| 6f 74 20 75 73 65 20 74 | 68 65 20 66 75 6c 6c 20 |ot use t|he full |
|000009d0| 63 75 72 73 65 73 20 70 | 61 63 6b 61 67 65 2e 0a |curses p|ackage..|
|000009e0| 58 0a 58 0a 58 41 20 46 | 45 57 20 4f 54 48 45 52 |X.X.XA F|EW OTHER|
|000009f0| 20 4e 4f 54 45 53 0a 58 | 0a 58 09 50 61 67 65 20 | NOTES.X|.X.Page |
|00000a00| 32 20 6f 66 20 74 68 65 | 20 75 73 65 72 73 20 6d |2 of the| users m|
|00000a10| 61 6e 75 61 6c 20 6d 65 | 6e 74 69 6f 6e 73 20 74 |anual me|ntions t|
|00000a20| 68 61 74 20 43 42 57 20 | 63 61 6e 6e 6f 74 20 77 |hat CBW |cannot w|
|00000a30| 6f 72 6b 0a 58 09 61 67 | 61 69 6e 73 74 20 66 69 |ork.X.ag|ainst fi|
|00000a40| 6c 65 73 20 74 68 61 74 | 20 68 61 76 65 20 62 65 |les that| have be|
|00000a50| 65 6e 20 72 75 6e 20 74 | 68 72 6f 75 67 68 20 63 |en run t|hrough c|
|00000a60| 6f 6d 70 72 65 73 73 20 | 28 31 29 20 62 65 66 6f |ompress |(1) befo|
|00000a70| 72 65 0a 58 65 6e 63 72 | 79 70 74 69 6f 6e 2e 20 |re.Xencr|yption. |
|00000a80| 20 50 65 72 73 6f 6e 61 | 6c 6c 79 2c 20 49 20 77 | Persona|lly, I w|
|00000a90| 6f 75 6c 64 20 70 72 65 | 66 65 72 20 74 6f 20 68 |ould pre|fer to h|
|00000aa0| 61 76 65 20 61 20 44 45 | 53 2d 62 61 73 65 64 0a |ave a DE|S-based.|
|00000ab0| 58 73 65 6c 66 2d 69 6e | 76 65 72 73 65 20 63 69 |Xself-in|verse ci|
|00000ac0| 70 68 65 72 2e 20 20 4d | 6f 73 74 20 44 45 53 20 |pher. M|ost DES |
|00000ad0| 70 72 6f 67 72 61 6d 73 | 20 6e 65 65 64 20 74 6f |programs| need to|
|00000ae0| 20 62 65 20 74 6f 6c 64 | 20 77 68 65 74 68 65 72 | be told| whether|
|00000af0| 20 74 68 65 79 0a 58 61 | 72 65 20 69 6e 20 65 6e | they.Xa|re in en|
|00000b00| 63 72 79 70 74 20 6f 72 | 20 64 65 63 72 79 70 74 |crypt or| decrypt|
|00000b10| 20 6d 6f 64 65 2e 20 20 | 48 6f 77 65 76 65 72 2c | mode. |However,|
|00000b20| 20 49 42 4d 20 6f 6e 6c | 79 20 67 72 61 6e 74 73 | IBM onl|y grants|
|00000b30| 20 66 72 65 65 20 75 73 | 65 20 6f 66 0a 58 44 45 | free us|e of.XDE|
|00000b40| 53 20 69 66 20 69 74 20 | 69 73 20 75 73 65 64 20 |S if it |is used |
|00000b50| 61 63 63 6f 72 64 69 6e | 67 20 74 6f 20 4e 42 53 |accordin|g to NBS|
|00000b60| 20 67 75 69 64 65 6c 69 | 6e 65 73 2c 20 61 6e 64 | guideli|nes, and|
|00000b70| 20 73 65 6c 66 2d 69 6e | 76 65 72 73 65 20 69 73 | self-in|verse is|
|00000b80| 20 6e 6f 74 0a 58 6f 6e | 65 20 6f 66 20 74 68 65 | not.Xon|e of the|
|00000b90| 20 61 63 63 65 70 74 65 | 64 20 6f 70 65 72 61 74 | accepte|d operat|
|00000ba0| 69 6e 67 20 6d 6f 64 65 | 73 2e 0a 58 0a 58 0a 58 |ing mode|s..X.X.X|
|00000bb0| 54 45 53 54 49 4e 47 0a | 58 0a 58 20 20 20 20 20 |TESTING.|X.X |
|00000bc0| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 69 73 |The foll|owing is|
|00000bd0| 20 61 20 73 74 65 70 20 | 62 79 20 73 74 65 70 20 | a step |by step |
|00000be0| 73 65 71 75 65 6e 63 65 | 20 6f 66 20 63 6f 6d 6d |sequence| of comm|
|00000bf0| 61 6e 64 73 20 74 6f 20 | 65 78 65 72 63 69 73 65 |ands to |exercise|
|00000c00| 0a 58 74 68 65 20 43 72 | 79 70 74 20 42 72 65 61 |.Xthe Cr|ypt Brea|
|00000c10| 6b 65 72 73 20 57 6f 72 | 6b 62 65 6e 63 68 2e 20 |kers Wor|kbench. |
|00000c20| 20 49 74 20 64 65 6d 6f | 6e 73 74 72 61 74 65 73 | It demo|nstrates|
|00000c30| 20 68 6f 77 20 65 61 73 | 69 6c 79 20 63 72 79 70 | how eas|ily cryp|
|00000c40| 74 20 66 69 6c 65 73 0a | 58 63 61 6e 20 62 65 20 |t files.|Xcan be |
|00000c50| 62 72 6f 6b 65 6e 2e 0a | 58 0a 58 20 20 20 31 2e |broken..|X.X 1.|
|00000c60| 20 45 64 69 74 20 20 73 | 74 61 74 73 2e 73 6c 69 | Edit s|tats.sli|
|00000c70| 63 65 20 74 6f 20 73 65 | 74 20 74 68 65 20 6e 61 |ce to se|t the na|
|00000c80| 6d 65 20 6f 66 20 74 68 | 65 20 64 69 72 65 63 74 |me of th|e direct|
|00000c90| 6f 72 79 20 74 68 61 74 | 20 63 6f 6e 74 61 69 6e |ory that| contain|
|00000ca0| 73 20 74 68 65 0a 58 20 | 20 20 20 20 20 73 74 61 |s the.X | sta|
|00000cb0| 74 69 73 74 69 63 73 20 | 66 69 6c 65 73 2e 20 20 |tistics |files. |
|00000cc0| 53 74 61 74 69 73 74 69 | 63 73 20 66 6f 72 20 73 |Statisti|cs for s|
|00000cd0| 63 72 69 62 65 20 64 6f | 63 75 6d 65 6e 74 73 20 |cribe do|cuments |
|00000ce0| 61 72 65 20 69 6e 63 6c | 75 64 65 64 20 77 69 74 |are incl|uded wit|
|00000cf0| 68 0a 58 20 20 20 20 20 | 20 74 68 65 20 73 6f 75 |h.X | the sou|
|00000d00| 72 63 65 20 66 69 6c 65 | 73 2e 0a 58 0a 58 20 20 |rce file|s..X.X |
|00000d10| 20 20 20 20 54 68 65 20 | 20 73 74 61 74 73 2e 73 | The | stats.s|
|00000d20| 6c 69 63 65 20 20 66 69 | 6c 65 20 20 61 6c 73 6f |lice fi|le also|
|00000d30| 20 20 64 65 66 69 6e 65 | 73 20 74 68 65 20 6c 6f | define|s the lo|
|00000d40| 63 61 74 69 6f 6e 20 6f | 66 20 74 68 65 20 64 69 |cation o|f the di|
|00000d50| 63 74 69 6f 6e 61 72 79 | 0a 58 20 20 20 20 20 20 |ctionary|.X |
|00000d60| 75 73 65 64 20 62 79 20 | 74 68 65 20 6c 6f 6f 6b |used by |the look|
|00000d70| 75 70 2d 70 61 74 74 65 | 72 6e 20 20 63 6f 6d 6d |up-patte|rn comm|
|00000d80| 61 6e 64 2e 20 20 20 20 | 54 68 65 20 20 64 65 66 |and. |The def|
|00000d90| 61 75 6c 74 20 20 64 69 | 63 74 69 6f 6e 61 72 79 |ault di|ctionary|
|00000da0| 20 20 69 73 0a 58 20 20 | 20 20 20 20 2f 75 73 72 | is.X | /usr|
|00000db0| 2f 64 69 63 74 2f 77 6f | 72 64 73 2e 20 20 20 20 |/dict/wo|rds. |
|00000dc0| 54 68 65 20 20 64 69 63 | 74 69 6f 6e 61 72 79 20 |The dic|tionary |
|00000dd0| 69 73 20 6a 75 73 74 20 | 61 20 6c 69 73 74 20 6f |is just |a list o|
|00000de0| 66 20 77 6f 72 64 73 2c | 20 6f 6e 65 20 70 65 72 |f words,| one per|
|00000df0| 0a 58 20 20 20 20 20 20 | 6c 69 6e 65 2e 20 20 43 |.X |line. C|
|00000e00| 61 73 65 20 64 6f 65 73 | 20 6e 6f 74 20 6d 61 74 |ase does| not mat|
|00000e10| 74 65 72 2e 0a 58 0a 58 | 20 20 20 32 2e 20 45 78 |ter..X.X| 2. Ex|
|00000e20| 65 63 75 74 65 20 27 73 | 6f 75 72 63 65 20 20 73 |ecute 's|ource s|
|00000e30| 74 61 74 73 2e 73 6c 69 | 63 65 27 20 20 74 6f 20 |tats.sli|ce' to |
|00000e40| 20 69 6e 69 74 69 61 6c | 69 7a 65 20 20 74 68 65 | initial|ize the|
|00000e50| 20 20 6e 65 63 65 73 73 | 61 72 79 20 20 73 68 65 | necess|ary she|
|00000e60| 6c 6c 0a 58 20 20 20 20 | 20 20 76 61 72 69 61 62 |ll.X | variab|
|00000e70| 6c 65 73 2e 0a 58 0a 58 | 20 20 20 33 2e 20 49 66 |les..X.X| 3. If|
|00000e80| 20 74 68 65 72 65 20 69 | 73 20 61 20 2e 73 6c 69 | there i|s a .sli|
|00000e90| 63 65 20 66 69 6c 65 20 | 66 6f 72 20 79 6f 75 72 |ce file |for your|
|00000ea0| 20 74 65 72 6d 69 6e 61 | 6c 20 74 79 70 65 20 28 | termina|l type (|
|00000eb0| 65 2e 67 2e 2c 20 76 74 | 31 30 30 2e 73 6c 69 63 |e.g., vt|100.slic|
|00000ec0| 65 2c 0a 58 20 20 20 20 | 20 20 6f 72 20 68 31 39 |e,.X | or h19|
|00000ed0| 2e 73 6c 69 63 65 29 2c | 20 65 78 65 63 75 74 65 |.slice),| execute|
|00000ee0| 20 73 6f 75 72 63 65 20 | 6f 6e 20 74 68 61 74 20 | source |on that |
|00000ef0| 66 69 6c 65 2e 20 20 20 | 54 68 69 73 20 20 69 6e |file. |This in|
|00000f00| 69 74 69 61 6c 69 7a 65 | 73 20 20 74 68 65 0a 58 |itialize|s the.X|
|00000f10| 20 20 20 20 20 20 67 72 | 61 70 68 69 63 73 20 6d | gr|aphics m|
|00000f20| 61 70 20 61 6e 64 20 6b | 65 79 20 6d 61 70 2e 0a |ap and k|ey map..|
|00000f30| 58 0a 58 20 20 20 34 2e | 20 50 72 69 6e 74 20 20 |X.X 4.| Print |
|00000f40| 6f 75 74 20 20 63 62 77 | 2e 64 6f 63 2c 20 20 73 |out cbw|.doc, s|
|00000f50| 6f 20 79 6f 75 20 63 61 | 6e 20 72 65 61 64 20 69 |o you ca|n read i|
|00000f60| 74 20 61 66 74 65 72 20 | 79 6f 75 20 68 61 76 65 |t after |you have|
|00000f70| 20 64 65 63 69 64 65 64 | 20 74 68 61 74 0a 58 20 | decided| that.X |
|00000f80| 20 20 20 20 20 79 6f 75 | 20 63 61 6e 27 74 20 66 | you| can't f|
|00000f90| 69 67 75 72 65 20 6f 75 | 74 20 68 6f 77 20 74 68 |igure ou|t how th|
|00000fa0| 65 20 70 72 6f 67 72 61 | 6d 20 77 6f 72 6b 73 2e |e progra|m works.|
|00000fb0| 0a 58 0a 58 20 20 20 35 | 2e 20 43 6f 70 79 20 74 |.X.X 5|. Copy t|
|00000fc0| 65 73 74 33 2e 70 65 72 | 6d 20 61 6e 64 20 2e 63 |est3.per|m and .c|
|00000fd0| 69 70 68 65 72 20 74 6f | 20 66 6f 6f 2e 70 65 72 |ipher to| foo.per|
|00000fe0| 6d 20 61 6e 64 20 66 6f | 6f 2e 63 69 70 68 65 72 |m and fo|o.cipher|
|00000ff0| 2e 20 20 20 20 54 68 65 | 20 20 2e 74 78 74 0a 58 |. The| .txt.X|
|00001000| 20 20 20 20 20 20 66 69 | 6c 65 73 20 63 6f 6e 74 | fi|les cont|
|00001010| 61 69 6e 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |ain the |original|
|00001020| 20 70 6c 61 69 6e 74 65 | 78 74 2e 0a 58 0a 58 20 | plainte|xt..X.X |
|00001030| 20 20 36 2e 20 45 78 65 | 63 75 74 65 20 27 63 62 | 6. Exe|cute 'cb|
|00001040| 77 20 66 6f 6f 27 2e 0a | 58 0a 58 20 20 20 37 2e |w foo'..|X.X 7.|
|00001050| 20 54 68 65 20 20 63 75 | 72 73 6f 72 20 20 77 69 | The cu|rsor wi|
|00001060| 6c 6c 20 20 6f 6e 20 74 | 68 65 20 63 6f 6d 6d 61 |ll on t|he comma|
|00001070| 6e 64 20 6c 69 6e 65 2e | 20 20 55 73 65 20 74 68 |nd line.| Use th|
|00001080| 65 20 61 72 72 6f 77 20 | 6b 65 79 73 20 28 6f 72 |e arrow |keys (or|
|00001090| 20 43 2d 50 2c 0a 58 20 | 20 20 20 20 20 43 2d 4e | C-P,.X | C-N|
|000010a0| 2c 20 43 2d 46 2c 20 43 | 2d 42 29 20 74 6f 20 6d |, C-F, C|-B) to m|
|000010b0| 6f 76 65 20 74 68 65 20 | 63 75 72 73 6f 72 20 74 |ove the |cursor t|
|000010c0| 6f 20 74 68 65 20 75 70 | 70 65 72 20 6c 65 66 74 |o the up|per left|
|000010d0| 68 61 6e 64 20 70 6f 73 | 69 74 69 6f 6e 20 20 6f |hand pos|ition o|
|000010e0| 66 0a 58 20 20 20 20 20 | 20 74 68 65 20 20 64 65 |f.X | the de|
|000010f0| 63 72 79 70 74 69 6f 6e | 20 20 77 69 6e 64 6f 77 |cryption| window|
|00001100| 2e 20 20 20 54 72 79 20 | 74 79 70 69 6e 67 20 27 |. Try |typing '|
|00001110| 40 44 65 76 69 63 65 5b | 44 6f 76 65 72 5d 27 2e |@Device[|Dover]'.|
|00001120| 20 20 4e 6f 74 69 63 65 | 20 74 68 61 74 0a 58 20 | Notice| that.X |
|00001130| 20 20 20 20 20 6d 6f 73 | 74 20 6f 66 20 74 68 65 | mos|t of the|
|00001140| 20 63 68 61 72 61 63 74 | 65 72 73 20 79 6f 75 20 | charact|ers you |
|00001150| 74 79 70 65 20 20 64 65 | 64 75 63 65 64 20 20 6f |type de|duced o|
|00001160| 74 68 65 72 20 20 63 68 | 61 72 61 63 74 65 72 73 |ther ch|aracters|
|00001170| 20 20 69 6e 20 20 74 68 | 65 0a 58 20 20 20 20 20 | in th|e.X |
|00001180| 20 62 6c 6f 63 6b 2e 0a | 58 0a 58 20 20 20 38 2e | block..|X.X 8.|
|00001190| 20 54 68 65 20 20 27 44 | 27 20 20 69 6e 20 20 27 | The 'D|' in '|
|000011a0| 44 6f 76 65 72 27 20 20 | 69 73 20 77 72 6f 6e 67 |Dover' |is wrong|
|000011b0| 2e 20 20 55 73 69 6e 67 | 20 74 68 65 20 61 72 72 |. Using| the arr|
|000011c0| 6f 77 20 6b 65 79 73 2c | 20 70 6f 73 69 74 69 6f |ow keys,| positio|
|000011d0| 6e 20 74 68 65 0a 58 20 | 20 20 20 20 20 63 75 72 |n the.X | cur|
|000011e0| 73 6f 72 20 6f 76 65 72 | 20 74 68 65 20 27 44 27 |sor over| the 'D'|
|000011f0| 20 61 6e 64 20 74 79 70 | 65 20 27 64 27 2e 0a 58 | and typ|e 'd'..X|
|00001200| 0a 58 20 20 20 39 2e 20 | 41 64 76 61 6e 63 65 20 |.X 9. |Advance |
|00001210| 74 6f 20 74 68 65 20 70 | 6f 73 69 74 69 6f 6e 20 |to the p|osition |
|00001220| 61 66 74 65 72 20 74 68 | 65 20 27 5d 27 20 61 6e |after th|e ']' an|
|00001230| 64 20 20 74 79 70 65 20 | 20 43 2d 54 2e 20 20 20 |d type | C-T. |
|00001240| 20 41 20 20 6c 69 73 74 | 20 20 6f 66 0a 58 20 20 | A list| of.X |
|00001250| 20 20 20 20 70 6f 73 73 | 69 62 6c 65 20 20 63 68 | poss|ible ch|
|00001260| 61 72 61 63 74 65 72 73 | 20 20 66 6f 72 20 74 68 |aracters| for th|
|00001270| 69 73 20 70 6f 73 69 74 | 69 6f 6e 20 77 69 6c 6c |is posit|ion will|
|00001280| 20 62 65 20 64 69 73 70 | 6c 61 79 65 64 2e 20 20 | be disp|layed. |
|00001290| 54 68 65 20 6c 69 73 74 | 0a 58 20 20 20 20 20 20 |The list|.X |
|000012a0| 69 73 20 73 6f 72 74 65 | 64 20 77 69 74 68 20 74 |is sorte|d with t|
|000012b0| 68 65 20 6d 6f 73 74 20 | 6c 69 6b 65 6c 79 20 63 |he most |likely c|
|000012c0| 68 61 72 61 63 74 65 72 | 20 6f 6e 20 74 68 65 20 |haracter| on the |
|000012d0| 6c 65 66 74 2e 20 20 20 | 4e 6f 74 69 63 65 20 20 |left. |Notice |
|000012e0| 74 68 61 74 0a 58 20 20 | 20 20 20 20 6d 61 6e 79 |that.X | many|
|000012f0| 20 63 68 61 72 61 63 74 | 65 72 73 20 61 72 65 20 | charact|ers are |
|00001300| 6e 6f 74 20 70 6f 73 73 | 69 62 6c 65 20 62 65 63 |not poss|ible bec|
|00001310| 61 75 73 65 20 74 68 65 | 79 20 77 6f 75 6c 64 20 |ause the|y would |
|00001320| 64 65 64 75 63 65 20 6e | 6f 6e 2d 61 73 63 69 69 |deduce n|on-ascii|
|00001330| 0a 58 20 20 20 20 20 20 | 63 68 61 72 61 63 74 65 |.X |characte|
|00001340| 72 73 20 65 6c 73 65 77 | 68 65 72 65 20 69 6e 20 |rs elsew|here in |
|00001350| 74 68 65 20 20 62 6c 6f | 63 6b 2c 20 20 6f 72 20 |the blo|ck, or |
|00001360| 20 74 68 65 79 20 20 77 | 6f 75 6c 64 20 20 63 6f | they w|ould co|
|00001370| 6e 66 6c 69 63 74 20 20 | 77 69 74 68 0a 58 20 20 |nflict |with.X |
|00001380| 20 20 20 20 70 72 65 76 | 69 6f 75 73 6c 79 20 61 | prev|iously a|
|00001390| 63 63 65 70 74 65 64 20 | 67 75 65 73 73 65 73 2e |ccepted |guesses.|
|000013a0| 0a 58 0a 58 20 20 20 20 | 20 20 54 72 79 20 20 67 |.X.X | Try g|
|000013b0| 75 65 73 73 69 6e 67 20 | 20 74 61 62 2c 20 20 63 |uessing | tab, c|
|000013c0| 6f 6d 6d 61 20 20 61 6e | 64 20 6c 69 6e 65 66 65 |omma an|d linefe|
|000013d0| 65 64 20 66 6f 72 20 74 | 68 65 20 63 68 61 72 61 |ed for t|he chara|
|000013e0| 63 74 65 72 20 61 66 74 | 65 72 20 74 68 65 0a 58 |cter aft|er the.X|
|000013f0| 20 20 20 20 20 20 27 5d | 27 2e 20 20 55 73 65 20 | ']|'. Use |
|00001400| 43 2d 47 20 74 6f 20 75 | 6e 64 6f 20 65 61 63 68 |C-G to u|ndo each|
|00001410| 20 67 75 65 73 73 2e 20 | 20 44 65 6c 65 74 65 20 | guess. | Delete |
|00001420| 61 6e 64 20 43 2d 44 20 | 64 6f 20 6e 6f 74 20 72 |and C-D |do not r|
|00001430| 65 73 74 6f 72 65 20 74 | 68 65 0a 58 20 20 20 20 |estore t|he.X |
|00001440| 20 20 6f 6c 64 20 20 73 | 74 61 74 65 2c 20 20 74 | old s|tate, t|
|00001450| 68 65 79 20 20 6a 75 73 | 74 20 20 65 72 61 73 65 |hey jus|t erase|
|00001460| 20 20 74 68 65 20 20 77 | 69 72 69 6e 67 20 20 74 | the w|iring t|
|00001470| 68 61 74 20 20 77 61 73 | 20 20 64 65 64 75 63 65 |hat was| deduce|
|00001480| 64 20 62 79 20 61 0a 58 | 20 20 20 20 20 20 70 61 |d by a.X| pa|
|00001490| 72 74 69 63 75 6c 61 72 | 20 63 68 61 72 61 63 74 |rticular| charact|
|000014a0| 65 72 2e 0a 58 0a 58 20 | 20 31 30 2e 20 4d 6f 76 |er..X.X | 10. Mov|
|000014b0| 65 20 74 68 65 20 63 75 | 72 73 6f 72 20 64 6f 77 |e the cu|rsor dow|
|000014c0| 6e 20 74 6f 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 |n to the| command|
|000014d0| 20 6c 69 6e 65 2e 20 20 | 59 6f 75 20 63 61 6e 20 | line. |You can |
|000014e0| 75 73 65 20 65 6d 61 63 | 73 20 20 63 75 72 73 6f |use emac|s curso|
|000014f0| 72 0a 58 20 20 20 20 20 | 20 63 68 61 72 61 63 74 |r.X | charact|
|00001500| 65 72 73 20 20 28 43 2d | 4e 2c 20 20 43 2d 50 2c |ers (C-|N, C-P,|
|00001510| 20 43 2d 46 2c 20 43 2d | 42 29 20 6f 72 20 74 68 | C-F, C-|B) or th|
|00001520| 65 20 61 72 72 6f 77 20 | 6b 65 79 73 2e 20 20 55 |e arrow |keys. U|
|00001530| 6e 66 6f 72 74 75 6e 61 | 74 65 6c 79 2c 0a 58 20 |nfortuna|tely,.X |
|00001540| 20 20 20 20 20 43 2d 55 | 20 64 6f 65 73 20 6e 6f | C-U| does no|
|00001550| 74 20 77 6f 72 6b 20 61 | 73 20 69 6e 20 65 6d 61 |t work a|s in ema|
|00001560| 63 73 2e 20 20 54 68 65 | 20 43 2d 58 20 6b 65 79 |cs. The| C-X key|
|00001570| 20 6f 72 20 46 34 20 77 | 69 6c 6c 20 6a 75 6d 70 | or F4 w|ill jump|
|00001580| 20 64 69 72 65 63 74 6c | 79 0a 58 20 20 20 20 20 | directl|y.X |
|00001590| 20 74 6f 20 74 68 65 20 | 63 6f 6d 6d 61 6e 64 20 | to the |command |
|000015a0| 6c 69 6e 65 2e 0a 58 0a | 58 20 20 31 31 2e 20 54 |line..X.|X 11. T|
|000015b0| 79 70 65 20 20 27 70 77 | 20 20 27 2e 20 20 20 20 |ype 'pw| '. |
|000015c0| 54 68 65 20 20 73 70 61 | 63 65 20 20 77 69 6c 6c |The spa|ce will|
|000015d0| 20 20 63 61 75 73 65 20 | 20 63 6f 6d 6d 61 6e 64 | cause | command|
|000015e0| 20 63 6f 6d 70 6c 65 74 | 69 6f 6e 20 66 6f 72 20 | complet|ion for |
|000015f0| 74 68 65 0a 58 20 20 20 | 20 20 20 70 72 6f 62 61 |the.X | proba|
|00001600| 62 6c 65 2d 77 6f 72 64 | 20 67 75 65 73 73 69 6e |ble-word| guessin|
|00001610| 67 20 63 6f 6d 6d 61 6e | 64 2e 20 20 54 79 70 65 |g comman|d. Type|
|00001620| 20 46 32 20 28 6f 72 20 | 43 2d 53 29 20 74 6f 20 | F2 (or |C-S) to |
|00001630| 61 64 76 61 6e 63 65 20 | 74 6f 20 20 74 68 65 0a |advance |to the.|
|00001640| 58 20 20 20 20 20 20 66 | 69 72 73 74 20 20 61 72 |X f|irst ar|
|00001650| 67 75 6d 65 6e 74 2c 20 | 20 61 6e 64 20 20 65 6e |gument, | and en|
|00001660| 74 65 72 20 20 74 68 65 | 20 20 66 69 6c 65 20 6e |ter the| file n|
|00001670| 61 6d 65 20 27 6d 73 73 | 2e 77 6f 72 64 73 27 2e |ame 'mss|.words'.|
|00001680| 20 20 54 68 61 74 20 66 | 69 6c 65 0a 58 20 20 20 | That f|ile.X |
|00001690| 20 20 20 63 6f 6e 74 61 | 69 6e 73 20 61 20 6c 69 | conta|ins a li|
|000016a0| 73 74 20 6f 66 20 6b 65 | 79 77 6f 72 64 73 20 75 |st of ke|ywords u|
|000016b0| 73 65 64 20 20 62 79 20 | 20 74 68 65 20 20 53 63 |sed by | the Sc|
|000016c0| 72 69 62 65 20 20 28 46 | 69 6e 61 6c 77 6f 72 64 |ribe (F|inalword|
|000016d0| 29 20 20 74 65 78 74 0a | 58 20 20 20 20 20 20 66 |) text.|X f|
|000016e0| 6f 72 6d 61 74 74 65 72 | 2e 20 20 20 20 50 72 65 |ormatter|. Pre|
|000016f0| 73 73 20 20 46 32 20 20 | 74 6f 20 20 61 64 76 61 |ss F2 |to adva|
|00001700| 6e 63 65 20 20 74 6f 20 | 20 74 68 65 20 73 65 63 |nce to | the sec|
|00001710| 6f 6e 64 20 61 72 67 75 | 6d 65 6e 74 2c 20 77 68 |ond argu|ment, wh|
|00001720| 69 63 68 0a 58 20 20 20 | 20 20 20 73 70 65 63 69 |ich.X | speci|
|00001730| 66 69 65 73 20 61 20 63 | 75 74 2d 6f 66 66 20 6c |fies a c|ut-off l|
|00001740| 65 76 65 6c 20 66 6f 72 | 20 61 75 74 6f 6d 61 74 |evel for| automat|
|00001750| 69 63 61 6c 6c 79 20 61 | 63 63 65 70 74 69 6e 67 |ically a|ccepting|
|00001760| 20 67 75 65 73 73 65 73 | 2e 20 20 20 54 68 65 0a | guesses|. The.|
|00001770| 58 20 20 20 20 20 20 6c | 65 76 65 6c 20 20 69 73 |X l|evel is|
|00001780| 20 74 68 65 20 6d 61 78 | 69 6d 75 6d 20 6e 75 6d | the max|imum num|
|00001790| 62 65 72 20 6f 66 20 73 | 74 61 6e 64 61 72 64 20 |ber of s|tandard |
|000017a0| 64 65 76 69 61 74 69 6f | 6e 73 20 74 68 61 74 20 |deviatio|ns that |
|000017b0| 74 68 65 20 73 63 6f 72 | 69 6e 67 0a 58 20 20 20 |the scor|ing.X |
|000017c0| 20 20 20 66 75 6e 63 74 | 69 6f 6e 20 63 61 6e 20 | funct|ion can |
|000017d0| 62 65 20 61 77 61 79 20 | 66 72 6f 6d 20 69 74 73 |be away |from its|
|000017e0| 20 65 78 70 65 63 74 65 | 64 20 76 61 6c 75 65 2e | expecte|d value.|
|000017f0| 20 20 45 6e 74 65 72 20 | 31 2e 32 2c 20 61 6e 64 | Enter |1.2, and|
|00001800| 20 20 70 72 65 73 73 0a | 58 20 20 20 20 20 20 72 | press.|X r|
|00001810| 65 74 75 72 6e 20 74 6f | 20 69 6e 76 6f 6b 65 20 |eturn to| invoke |
|00001820| 74 68 65 20 63 6f 6d 6d | 61 6e 64 2e 0a 58 0a 58 |the comm|and..X.X|
|00001830| 20 20 31 32 2e 20 41 20 | 20 70 61 72 74 69 61 6c | 12. A | partial|
|00001840| 6c 79 20 66 69 6c 6c 65 | 64 20 69 6e 20 62 6c 6f |ly fille|d in blo|
|00001850| 63 6b 20 77 69 6c 6c 20 | 61 70 70 65 61 72 20 69 |ck will |appear i|
|00001860| 6e 20 74 68 65 20 67 75 | 65 73 73 69 6e 67 20 77 |n the gu|essing w|
|00001870| 69 6e 64 6f 77 2e 20 20 | 54 6f 0a 58 20 20 20 20 |indow. |To.X |
|00001880| 20 20 61 63 63 65 70 74 | 20 74 68 65 20 72 65 73 | accept| the res|
|00001890| 75 6c 74 20 6f 66 20 74 | 68 69 73 20 63 6f 6d 6d |ult of t|his comm|
|000018a0| 61 6e 64 2c 20 70 72 65 | 73 73 20 46 33 20 28 6f |and, pre|ss F3 (o|
|000018b0| 72 20 43 2d 41 29 2e 0a | 58 0a 58 20 20 31 33 2e |r C-A)..|X.X 13.|
|000018c0| 20 54 72 79 20 74 68 65 | 20 70 77 6f 72 64 20 67 | Try the| pword g|
|000018d0| 75 65 73 73 20 63 6f 6d | 6d 61 6e 64 20 61 67 61 |uess com|mand aga|
|000018e0| 69 6e 20 77 69 74 68 20 | 61 20 6c 65 76 65 6c 20 |in with |a level |
|000018f0| 6f 66 20 33 2e 20 20 20 | 54 6f 20 20 64 6f 20 20 |of 3. |To do |
|00001900| 74 68 69 73 2c 0a 58 20 | 20 20 20 20 20 6a 75 73 |this,.X | jus|
|00001910| 74 20 20 6d 6f 76 65 20 | 20 74 6f 20 20 74 68 65 |t move | to the|
|00001920| 20 20 63 6f 6d 6d 61 6e | 64 20 20 6c 69 6e 65 2c | comman|d line,|
|00001930| 20 63 68 61 6e 67 65 20 | 74 68 65 20 31 2e 32 20 | change |the 1.2 |
|00001940| 74 6f 20 61 20 33 2c 20 | 61 6e 64 20 70 72 65 73 |to a 3, |and pres|
|00001950| 73 0a 58 20 20 20 20 20 | 20 72 65 74 75 72 6e 2e |s.X | return.|
|00001960| 20 20 41 67 61 69 6e 20 | 46 33 20 61 63 63 65 70 | Again |F3 accep|
|00001970| 74 73 20 74 68 65 20 67 | 75 65 73 73 2e 20 20 49 |ts the g|uess. I|
|00001980| 66 20 20 73 6f 6d 65 20 | 20 67 75 65 73 73 65 73 |f some | guesses|
|00001990| 20 20 6c 6f 6f 6b 20 20 | 77 72 6f 6e 67 0a 58 20 | look |wrong.X |
|000019a0| 20 20 20 20 20 28 73 75 | 63 68 20 20 61 73 20 74 | (su|ch as t|
|000019b0| 68 65 20 27 46 27 20 6f | 6e 20 74 68 65 20 73 65 |he 'F' o|n the se|
|000019c0| 63 6f 6e 64 20 6c 69 6e | 65 20 75 6e 64 65 72 20 |cond lin|e under |
|000019d0| 74 68 65 20 27 5b 41 72 | 74 69 63 6c 65 5d 27 29 |the '[Ar|ticle]')|
|000019e0| 2c 20 79 6f 75 20 63 61 | 6e 0a 58 20 20 20 20 20 |, you ca|n.X |
|000019f0| 20 63 6f 72 72 65 63 74 | 20 74 68 65 6d 20 75 73 | correct| them us|
|00001a00| 69 6e 67 20 74 68 65 20 | 65 64 69 74 6f 72 20 69 |ing the |editor i|
|00001a10| 6e 20 74 68 65 20 64 65 | 63 72 79 70 74 69 6f 6e |n the de|cryption|
|00001a20| 20 62 6c 6f 63 6b 20 77 | 69 6e 64 6f 77 2e 0a 58 | block w|indow..X|
|00001a30| 0a 58 20 20 31 34 2e 20 | 41 64 76 61 6e 63 65 20 |.X 14. |Advance |
|00001a40| 74 6f 20 62 6c 6f 63 6b | 20 20 31 20 20 6f 66 20 |to block| 1 of |
|00001a50| 20 74 68 65 20 20 66 69 | 6c 65 20 20 62 79 20 20 | the fi|le by |
|00001a60| 6d 6f 76 69 6e 67 20 20 | 74 68 65 20 20 63 75 72 |moving |the cur|
|00001a70| 73 6f 72 20 20 74 6f 20 | 20 74 68 65 0a 58 20 20 |sor to | the.X |
|00001a80| 20 20 20 20 64 65 63 72 | 79 70 74 69 6f 6e 20 20 | decr|yption |
|00001a90| 77 69 6e 64 6f 77 20 61 | 6e 64 20 70 72 65 73 73 |window a|nd press|
|00001aa0| 69 6e 67 20 46 32 20 28 | 6f 72 20 43 2d 53 29 2e |ing F2 (|or C-S).|
|00001ab0| 20 20 46 31 20 28 6f 72 | 20 43 2d 52 29 20 6d 6f | F1 (or| C-R) mo|
|00001ac0| 76 65 73 20 62 61 63 6b | 0a 58 20 20 20 20 20 20 |ves back|.X |
|00001ad0| 6f 6e 65 20 62 6c 6f 63 | 6b 2c 20 46 32 20 6d 6f |one bloc|k, F2 mo|
|00001ae0| 76 65 73 20 61 68 65 61 | 64 20 6f 6e 65 20 62 6c |ves ahea|d one bl|
|00001af0| 6f 63 6b 2e 0a 58 0a 58 | 20 20 31 35 2e 20 54 68 |ock..X.X| 15. Th|
|00001b00| 65 20 73 65 63 6f 6e 64 | 20 62 6c 6f 63 6b 20 69 |e second| block i|
|00001b10| 73 20 6c 69 6b 65 6c 79 | 20 74 6f 20 20 62 65 20 |s likely| to be |
|00001b20| 20 70 6c 61 69 6e 20 20 | 65 6e 67 6c 69 73 68 20 | plain |english |
|00001b30| 20 77 69 74 68 20 20 66 | 65 77 20 20 73 63 72 69 | with f|ew scri|
|00001b40| 62 65 0a 58 20 20 20 20 | 20 20 63 6f 6d 6d 61 6e |be.X | comman|
|00001b50| 64 73 2e 20 20 20 20 4d | 6f 76 65 20 20 74 6f 20 |ds. M|ove to |
|00001b60| 74 68 65 20 63 6f 6d 6d | 61 6e 64 20 77 69 6e 64 |the comm|and wind|
|00001b70| 6f 77 2c 20 74 79 70 65 | 20 43 2d 55 20 74 6f 20 |ow, type| C-U to |
|00001b80| 65 72 61 73 65 20 74 68 | 65 20 6c 69 6e 65 0a 58 |erase th|e line.X|
|00001b90| 20 20 20 20 20 20 61 6e | 64 20 74 79 70 65 20 27 | an|d type '|
|00001ba0| 62 69 20 27 20 74 6f 20 | 20 73 65 74 75 70 20 20 |bi ' to | setup |
|00001bb0| 74 68 65 20 20 62 69 67 | 72 61 6d 20 20 67 75 65 |the big|ram gue|
|00001bc0| 73 73 69 6e 67 20 20 63 | 6f 6d 6d 61 6e 64 2e 20 |ssing c|ommand. |
|00001bd0| 20 20 20 54 72 79 20 20 | 61 6e 0a 58 20 20 20 20 | Try |an.X |
|00001be0| 20 20 61 63 63 65 70 74 | 61 6e 63 65 20 20 6c 65 | accept|ance le|
|00001bf0| 76 65 6c 20 20 6f 66 20 | 20 31 2e 30 20 20 61 6e |vel of | 1.0 an|
|00001c00| 64 20 20 61 20 6d 69 6e | 69 6d 75 6d 20 70 72 6f |d a min|imum pro|
|00001c10| 62 61 62 69 6c 69 74 79 | 20 6f 66 20 30 2e 36 2e |bability| of 0.6.|
|00001c20| 20 20 54 79 70 65 0a 58 | 20 20 20 20 20 20 72 65 | Type.X| re|
|00001c30| 74 75 72 6e 20 74 6f 20 | 69 6e 76 6f 6b 65 20 74 |turn to |invoke t|
|00001c40| 68 65 20 63 6f 6d 6d 61 | 6e 64 2e 0a 58 0a 58 20 |he comma|nd..X.X |
|00001c50| 20 31 36 2e 20 41 66 74 | 65 72 20 61 20 73 68 6f | 16. Aft|er a sho|
|00001c60| 72 74 20 77 61 69 74 20 | 28 7e 31 35 20 20 73 65 |rt wait |(~15 se|
|00001c70| 63 6f 6e 64 73 29 2c 20 | 20 61 20 20 70 61 72 74 |conds), | a part|
|00001c80| 69 61 6c 20 20 62 6c 6f | 63 6b 20 20 77 69 6c 6c |ial blo|ck will|
|00001c90| 20 20 61 70 70 65 61 72 | 2e 0a 58 20 20 20 20 20 | appear|..X |
|00001ca0| 20 41 63 63 65 70 74 20 | 74 68 65 20 67 75 65 73 | Accept |the gues|
|00001cb0| 73 20 77 69 74 68 20 74 | 68 65 20 46 33 20 6b 65 |s with t|he F3 ke|
|00001cc0| 79 20 69 6e 20 74 68 65 | 20 67 75 65 73 73 69 6e |y in the| guessin|
|00001cd0| 67 20 77 69 6e 64 6f 77 | 2e 0a 58 0a 58 20 20 31 |g window|..X.X 1|
|00001ce0| 37 2e 20 54 72 79 20 20 | 6c 6f 6f 6b 69 6e 67 20 |7. Try |looking |
|00001cf0| 20 75 70 20 61 20 70 61 | 74 74 65 72 6e 20 69 6e | up a pa|ttern in|
|00001d00| 20 74 68 65 20 64 69 63 | 74 69 6f 6e 61 72 79 2e | the dic|tionary.|
|00001d10| 20 20 49 6e 20 74 68 65 | 20 63 6f 6d 6d 61 6e 64 | In the| command|
|00001d20| 20 77 69 6e 64 6f 77 0a | 58 20 20 20 20 20 20 74 | window.|X t|
|00001d30| 79 70 65 20 27 6c 6f 6f | 6b 20 27 2c 20 75 73 65 |ype 'loo|k ', use|
|00001d40| 20 46 32 20 74 6f 20 61 | 64 76 61 6e 63 65 20 74 | F2 to a|dvance t|
|00001d50| 6f 20 74 68 65 20 20 70 | 61 74 74 65 72 6e 2c 20 |o the p|attern, |
|00001d60| 20 61 6e 64 20 20 74 79 | 70 65 20 20 69 6e 20 20 | and ty|pe in |
|00001d70| 74 68 65 0a 58 20 20 20 | 20 20 20 70 61 74 74 65 |the.X | patte|
|00001d80| 72 6e 20 20 27 2e 2e 2e | 2e 6c 6c 69 74 2e 27 2c |rn '...|.llit.',|
|00001d90| 20 61 6e 64 20 70 72 65 | 73 73 20 72 65 74 75 72 | and pre|ss retur|
|00001da0| 6e 2e 20 20 54 68 69 73 | 20 77 69 6c 6c 20 6d 61 |n. This| will ma|
|00001db0| 74 63 68 20 61 67 61 69 | 6e 73 74 20 74 68 65 0a |tch agai|nst the.|
|00001dc0| 58 20 20 20 20 20 20 77 | 6f 72 64 20 27 73 61 74 |X w|ord 'sat|
|00001dd0| 65 6c 6c 69 74 65 27 20 | 69 66 20 69 74 20 69 73 |ellite' |if it is|
|00001de0| 20 69 6e 20 79 6f 75 20 | 73 69 74 65 27 73 20 64 | in you |site's d|
|00001df0| 69 63 74 69 6f 6e 61 72 | 79 2e 0a 58 0a 58 20 20 |ictionar|y..X.X |
|00001e00| 31 38 2e 20 4f 6e 65 20 | 63 6f 75 6c 64 20 67 6f |18. One |could go|
|00001e10| 20 6f 6e 20 6c 69 6b 65 | 20 74 68 69 73 2c 20 62 | on like| this, b|
|00001e20| 75 74 20 6c 65 74 27 73 | 20 73 6b 69 70 20 20 61 |ut let's| skip a|
|00001e30| 68 65 61 64 20 20 62 79 | 20 20 6c 6f 61 64 69 6e |head by| loadin|
|00001e40| 67 20 20 69 6e 20 20 61 | 0a 58 20 20 20 20 20 20 |g in a|.X |
|00001e50| 70 72 65 76 69 6f 75 73 | 6c 79 20 20 73 61 76 65 |previous|ly save|
|00001e60| 64 20 73 74 61 74 65 2e | 20 20 49 6e 76 6f 6b 65 |d state.| Invoke|
|00001e70| 20 74 68 65 20 6c 6f 61 | 64 20 63 6f 6d 6d 61 6e | the loa|d comman|
|00001e80| 64 20 28 69 74 20 6c 6f | 61 64 73 20 74 68 65 20 |d (it lo|ads the |
|00001e90| 66 69 6c 65 0a 58 20 20 | 20 20 20 20 66 6f 6f 2e |file.X | foo.|
|00001ea0| 70 65 72 6d 2c 20 6a 75 | 73 74 20 61 73 20 73 61 |perm, ju|st as sa|
|00001eb0| 76 65 20 64 75 6d 70 73 | 20 74 6f 20 66 6f 6f 2e |ve dumps| to foo.|
|00001ec0| 70 65 72 6d 20 28 6d 61 | 6b 69 6e 67 20 74 68 69 |perm (ma|king thi|
|00001ed0| 73 20 63 6f 6d 6d 61 6e | 64 20 74 61 6b 65 20 61 |s comman|d take a|
|00001ee0| 0a 58 20 20 20 20 20 20 | 66 69 6c 65 6e 61 6d 65 |.X |filename|
|00001ef0| 20 20 69 73 20 20 61 20 | 20 67 6f 6f 64 20 69 6d | is a | good im|
|00001f00| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 65 78 65 |plementa|tion exe|
|00001f10| 72 63 69 73 65 29 29 2e | 20 20 54 79 70 65 20 43 |rcise)).| Type C|
|00001f20| 2d 55 2c 20 27 6c 6f 61 | 64 20 27 2c 0a 58 20 20 |-U, 'loa|d ',.X |
|00001f30| 20 20 20 20 61 6e 64 20 | 72 65 74 75 72 6e 2e 20 | and |return. |
|00001f40| 20 4e 6f 74 69 63 65 20 | 74 68 61 74 20 61 6c 6c | Notice |that all|
|00001f50| 20 74 68 65 20 77 6f 72 | 6b 20 73 6f 20 20 66 61 | the wor|k so fa|
|00001f60| 72 20 20 69 73 20 20 72 | 65 70 6c 61 63 65 64 20 |r is r|eplaced |
|00001f70| 20 62 79 20 20 74 68 65 | 0a 58 20 20 20 20 20 20 | by the|.X |
|00001f80| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 69 6e 20 74 |informat|ion in t|
|00001f90| 68 65 20 2e 70 65 72 6d | 20 66 69 6c 65 2e 20 20 |he .perm| file. |
|00001fa0| 54 68 69 73 20 63 61 6e | 20 62 65 20 63 6f 6e 73 |This can| be cons|
|00001fb0| 69 64 65 72 65 64 20 61 | 20 66 65 61 74 75 72 65 |idered a| feature|
|00001fc0| 2e 0a 58 0a 58 20 20 31 | 39 2e 20 55 73 65 20 20 |..X.X 1|9. Use |
|00001fd0| 74 68 65 20 20 46 31 20 | 61 6e 64 20 46 32 20 6b |the F1 |and F2 k|
|00001fe0| 65 79 73 20 69 6e 20 74 | 68 65 20 64 65 63 72 79 |eys in t|he decry|
|00001ff0| 70 74 69 6f 6e 20 77 69 | 6e 64 6f 77 20 74 6f 20 |ption wi|ndow to |
|00002000| 76 69 65 77 20 74 68 65 | 20 62 6c 6f 63 6b 73 0a |view the| blocks.|
|00002010| 58 20 20 20 20 20 20 74 | 68 61 74 20 68 61 76 65 |X t|hat have|
|00002020| 20 62 65 65 6e 20 73 6f | 6c 76 65 64 2e 20 20 4e | been so|lved. N|
|00002030| 6f 74 69 63 65 20 74 68 | 61 74 20 61 20 66 75 6c |otice th|at a ful|
|00002040| 6c 79 20 73 6f 6c 76 65 | 64 20 20 62 6c 6f 63 6b |ly solve|d block|
|00002050| 20 20 64 6f 65 73 20 20 | 6e 6f 74 0a 58 20 20 20 | does |not.X |
|00002060| 20 20 20 73 70 65 63 69 | 66 79 20 20 61 6c 6c 20 | speci|fy all |
|00002070| 20 74 68 65 20 77 69 72 | 69 6e 67 73 20 6f 66 20 | the wir|ings of |
|00002080| 74 68 65 20 62 6c 6f 63 | 6b 20 6b 65 79 20 28 70 |the bloc|k key (p|
|00002090| 65 72 6d 75 74 61 74 69 | 6f 6e 29 2e 20 20 54 79 |ermutati|on). Ty|
|000020a0| 70 69 63 61 6c 6c 79 0a | 58 20 20 20 20 20 20 6f |pically.|X o|
|000020b0| 6e 6c 79 20 31 30 35 20 | 6f 66 20 74 68 65 20 31 |nly 105 |of the 1|
|000020c0| 32 38 20 77 69 72 65 73 | 20 61 72 65 20 75 73 65 |28 wires| are use|
|000020d0| 64 2e 0a 58 0a 58 20 20 | 32 30 2e 20 4c 65 74 73 |d..X.X |20. Lets|
|000020e0| 20 74 72 79 20 64 65 64 | 75 63 69 6e 67 20 74 68 | try ded|ucing th|
|000020f0| 65 20 69 6e 74 65 72 2d | 62 6c 6f 63 6b 20 72 65 |e inter-|block re|
|00002100| 6c 61 74 69 6f 6e 73 68 | 69 70 20 28 7a 65 65 29 |lationsh|ip (zee)|
|00002110| 2e 20 20 20 45 78 65 63 | 75 74 65 20 20 74 68 65 |. Exec|ute the|
|00002120| 0a 58 20 20 20 20 20 20 | 63 6c 65 61 72 2d 7a 65 |.X |clear-ze|
|00002130| 65 20 63 6f 6d 6d 61 6e | 64 2e 0a 58 0a 58 20 20 |e comman|d..X.X |
|00002140| 32 31 2e 20 45 78 65 63 | 75 74 65 20 20 6b 6e 69 |21. Exec|ute kni|
|00002150| 74 20 20 62 6c 6f 63 6b | 73 20 30 20 74 68 72 6f |t block|s 0 thro|
|00002160| 75 67 68 20 33 20 77 69 | 74 68 20 61 20 6d 69 6e |ugh 3 wi|th a min|
|00002170| 20 73 68 6f 77 20 63 6f | 75 6e 74 20 6f 66 20 32 | show co|unt of 2|
|00002180| 30 2e 20 20 54 68 69 73 | 0a 58 20 20 20 20 20 20 |0. This|.X |
|00002190| 6d 65 61 6e 73 20 74 68 | 61 74 20 74 68 65 20 70 |means th|at the p|
|000021a0| 72 6f 67 72 61 6d 20 73 | 68 6f 75 6c 64 20 6f 6e |rogram s|hould on|
|000021b0| 6c 79 20 73 68 6f 77 20 | 79 6f 75 20 67 75 65 73 |ly show |you gues|
|000021c0| 73 65 73 20 74 68 61 74 | 20 20 64 65 64 75 63 65 |ses that| deduce|
|000021d0| 20 20 32 30 0a 58 20 20 | 20 20 20 20 6f 72 20 6d | 20.X | or m|
|000021e0| 6f 72 65 20 77 69 72 69 | 6e 67 73 20 6f 66 20 74 |ore wiri|ngs of t|
|000021f0| 68 65 20 7a 65 65 20 70 | 65 72 6d 75 74 61 74 69 |he zee p|ermutati|
|00002200| 6f 6e 2e 20 20 50 72 65 | 73 73 20 72 65 74 75 72 |on. Pre|ss retur|
|00002210| 6e 20 74 6f 20 69 6e 76 | 6f 6b 65 20 74 68 69 73 |n to inv|oke this|
|00002220| 0a 58 20 20 20 20 20 20 | 67 75 65 73 73 69 6e 67 |.X |guessing|
|00002230| 20 73 74 72 61 74 65 67 | 79 2e 20 20 54 68 65 20 | strateg|y. The |
|00002240| 63 75 72 73 6f 72 20 77 | 69 6c 6c 20 6d 6f 76 65 |cursor w|ill move|
|00002250| 20 20 74 6f 20 20 74 68 | 65 20 20 67 75 65 73 73 | to th|e guess|
|00002260| 69 6e 67 20 20 77 69 6e | 64 6f 77 2e 0a 58 20 20 |ing win|dow..X |
|00002270| 20 20 20 20 50 72 65 73 | 73 20 46 32 20 74 6f 20 | Pres|s F2 to |
|00002280| 73 74 61 72 74 20 74 68 | 65 20 66 69 72 73 74 20 |start th|e first |
|00002290| 72 6f 75 6e 64 20 6f 66 | 20 67 75 65 73 73 69 6e |round of| guessin|
|000022a0| 67 2e 0a 58 0a 58 20 20 | 20 20 20 20 54 68 65 20 |g..X.X | The |
|000022b0| 72 75 6e 6e 69 6e 67 20 | 74 69 6d 65 20 6f 66 20 |running |time of |
|000022c0| 74 68 65 20 6b 6e 69 74 | 20 63 6f 6d 6d 61 6e 64 |the knit| command|
|000022d0| 20 69 73 20 65 78 70 6f | 6e 65 6e 74 69 61 6c 20 | is expo|nential |
|000022e0| 69 6e 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |in the n|umber of|
|000022f0| 0a 58 20 20 20 20 20 20 | 62 6c 6f 63 6b 73 20 6b |.X |blocks k|
|00002300| 6e 69 74 74 65 64 2c 20 | 61 6e 64 20 69 74 20 77 |nitted, |and it w|
|00002310| 69 6c 6c 20 72 75 6e 20 | 66 6f 72 20 61 20 76 65 |ill run |for a ve|
|00002320| 72 79 20 6c 6f 6e 67 20 | 74 69 6d 65 20 69 66 20 |ry long |time if |
|00002330| 61 6e 79 20 20 6f 66 20 | 20 74 68 65 0a 58 20 20 |any of | the.X |
|00002340| 20 20 20 20 62 6c 6f 63 | 6b 73 20 20 61 72 65 20 | bloc|ks are |
|00002350| 20 64 65 63 72 79 70 74 | 65 64 20 69 6e 63 6f 72 | decrypt|ed incor|
|00002360| 72 65 63 74 6c 79 2e 20 | 20 54 68 69 73 20 6d 65 |rectly. | This me|
|00002370| 61 6e 73 20 74 68 61 74 | 20 69 74 20 69 73 20 62 |ans that| it is b|
|00002380| 65 74 74 65 72 20 74 6f | 0a 58 20 20 20 20 20 20 |etter to|.X |
|00002390| 6c 65 61 76 65 20 61 20 | 70 6f 73 69 74 69 6f 6e |leave a |position|
|000023a0| 20 62 6c 61 6e 6b 20 74 | 68 61 6e 20 74 6f 20 67 | blank t|han to g|
|000023b0| 75 65 73 73 20 61 74 20 | 69 74 2e 0a 58 0a 58 20 |uess at |it..X.X |
|000023c0| 20 32 32 2e 20 54 68 65 | 20 70 72 6f 67 72 61 6d | 22. The| program|
|000023d0| 20 6d 6f 76 65 73 20 74 | 6f 20 62 6c 6f 63 6b 20 | moves t|o block |
|000023e0| 34 20 61 6e 64 20 73 68 | 6f 77 73 20 79 6f 75 20 |4 and sh|ows you |
|000023f0| 74 68 65 20 63 68 61 72 | 61 63 74 65 72 73 20 69 |the char|acters i|
|00002400| 6e 20 62 6c 6f 63 6b 20 | 34 0a 58 20 20 20 20 20 |n block |4.X |
|00002410| 20 74 68 61 74 20 77 6f | 75 6c 64 20 62 65 20 64 | that wo|uld be d|
|00002420| 65 64 75 63 65 64 20 66 | 72 6f 6d 20 62 6c 6f 63 |educed f|rom bloc|
|00002430| 6b 20 33 20 67 69 76 65 | 6e 20 74 68 65 20 64 65 |k 3 give|n the de|
|00002440| 64 75 63 65 64 20 77 69 | 72 69 6e 67 73 20 6f 66 |duced wi|rings of|
|00002450| 20 7a 65 65 2e 0a 58 20 | 20 20 20 20 20 49 66 20 | zee..X | If |
|00002460| 74 68 65 73 65 20 6c 6f | 6f 6b 20 72 65 61 73 6f |these lo|ok reaso|
|00002470| 6e 61 62 6c 65 2c 20 70 | 72 65 73 73 20 46 33 20 |nable, p|ress F3 |
|00002480| 74 6f 20 61 63 63 65 70 | 74 20 74 68 65 20 67 75 |to accep|t the gu|
|00002490| 65 73 73 2c 20 61 6e 64 | 20 70 72 65 73 73 20 46 |ess, and| press F|
|000024a0| 32 0a 58 20 20 20 20 20 | 20 74 6f 20 74 72 79 20 |2.X | to try |
|000024b0| 74 68 65 20 6e 65 78 74 | 20 67 75 65 73 73 2e 20 |the next| guess. |
|000024c0| 20 54 6f 20 72 65 6a 65 | 63 74 20 61 20 67 75 65 | To reje|ct a gue|
|000024d0| 73 73 2c 20 70 72 65 73 | 73 20 46 32 20 77 69 74 |ss, pres|s F2 wit|
|000024e0| 68 6f 75 74 20 70 72 65 | 73 73 69 6e 67 0a 58 20 |hout pre|ssing.X |
|000024f0| 20 20 20 20 20 46 33 2e | 0a 58 0a 58 20 20 32 33 | F3.|.X.X 23|
|00002500| 2e 20 4e 6f 77 20 74 68 | 61 74 20 70 61 72 74 20 |. Now th|at part |
|00002510| 6f 66 20 7a 65 65 20 69 | 73 20 6b 6e 6f 77 6e 2c |of zee i|s known,|
|00002520| 20 74 72 79 20 70 72 6f | 70 61 67 61 74 69 6e 67 | try pro|pagating|
|00002530| 20 74 68 65 20 73 65 74 | 74 69 6e 67 73 20 6f 66 | the set|tings of|
|00002540| 20 62 6c 6f 63 6b 0a 58 | 20 20 20 20 20 20 31 20 | block.X| 1 |
|00002550| 69 6e 74 6f 20 62 6c 6f | 63 6b 20 30 20 75 73 69 |into blo|ck 0 usi|
|00002560| 6e 67 20 7a 65 65 2e 20 | 20 54 68 65 20 70 72 6f |ng zee. | The pro|
|00002570| 70 61 67 61 74 65 20 63 | 6f 6d 6d 61 6e 64 20 77 |pagate c|ommand w|
|00002580| 69 6c 6c 20 64 6f 20 74 | 68 69 73 2e 20 20 41 6c |ill do t|his. Al|
|00002590| 73 6f 0a 58 20 20 20 20 | 20 20 74 72 79 20 70 72 |so.X | try pr|
|000025a0| 6f 70 61 67 61 74 69 6e | 67 20 62 6c 6f 63 6b 73 |opagatin|g blocks|
|000025b0| 20 32 2c 20 33 2c 20 61 | 6e 64 20 34 20 74 6f 20 | 2, 3, a|nd 4 to |
|000025c0| 7a 65 72 6f 2e 0a 58 0a | 58 20 20 20 20 20 20 4e |zero..X.|X N|
|000025d0| 6f 74 69 63 65 20 74 68 | 61 74 20 74 68 65 20 6e |otice th|at the n|
|000025e0| 75 6d 62 65 72 20 6f 66 | 20 6b 6e 6f 77 6e 20 77 |umber of| known w|
|000025f0| 69 72 65 73 20 63 61 6e | 20 69 6e 63 72 65 61 73 |ires can| increas|
|00002600| 65 20 77 69 74 68 6f 75 | 74 20 20 64 65 64 75 63 |e withou|t deduc|
|00002610| 69 6e 67 0a 58 20 20 20 | 20 20 20 61 64 64 69 74 |ing.X | addit|
|00002620| 69 6f 6e 61 6c 20 63 68 | 61 72 61 63 74 65 72 73 |ional ch|aracters|
|00002630| 20 69 6e 20 74 68 65 20 | 62 6c 6f 63 6b 2e 0a 58 | in the |block..X|
|00002640| 0a 58 20 20 32 34 2e 20 | 54 68 65 72 65 20 73 68 |.X 24. |There sh|
|00002650| 6f 75 6c 64 20 62 65 20 | 61 20 63 6f 6d 6d 61 6e |ould be |a comman|
|00002660| 64 20 74 68 61 74 20 70 | 72 6f 70 61 67 61 74 65 |d that p|ropagate|
|00002670| 73 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 62 65 |s inform|ation be|
|00002680| 74 77 65 65 6e 20 67 72 | 6f 75 70 73 0a 58 20 20 |tween gr|oups.X |
|00002690| 20 20 20 20 6f 66 20 62 | 6c 6f 63 6b 73 2c 20 62 | of b|locks, b|
|000026a0| 75 74 20 66 6f 72 20 6e | 6f 77 20 79 6f 75 20 6d |ut for n|ow you m|
|000026b0| 75 73 74 20 64 6f 20 74 | 68 69 73 20 6f 6e 65 20 |ust do t|his one |
|000026c0| 62 6c 6f 63 6b 20 61 74 | 20 61 20 74 69 6d 65 2e |block at| a time.|
|000026d0| 20 20 20 41 66 74 65 72 | 0a 58 20 20 20 20 20 20 | After|.X |
|000026e0| 70 72 6f 70 61 67 61 74 | 69 6e 67 20 20 62 6c 6f |propagat|ing blo|
|000026f0| 63 6b 20 31 20 2d 20 34 | 20 74 6f 20 62 6c 6f 63 |ck 1 - 4| to bloc|
|00002700| 6b 20 7a 65 72 6f 2c 20 | 61 6e 64 20 62 6c 6f 63 |k zero, |and bloc|
|00002710| 6b 20 7a 65 72 6f 20 74 | 6f 20 62 6c 6f 63 6b 73 |k zero t|o blocks|
|00002720| 20 31 20 2d 0a 58 20 20 | 20 20 20 20 34 2c 20 65 | 1 -.X | 4, e|
|00002730| 74 20 63 65 74 65 72 61 | 2c 20 74 72 79 20 74 68 |t cetera|, try th|
|00002740| 65 20 6b 6e 69 74 20 63 | 6f 6d 6d 61 6e 64 20 61 |e knit c|ommand a|
|00002750| 67 61 69 6e 2e 0a 58 0a | 58 20 20 32 35 2e 20 50 |gain..X.|X 25. P|
|00002760| 72 6f 70 61 67 61 74 65 | 20 62 6c 6f 63 6b 20 34 |ropagate| block 4|
|00002770| 20 74 6f 20 35 20 20 74 | 6f 20 20 70 72 6f 76 69 | to 5 t|o provi|
|00002780| 64 65 20 20 61 20 20 66 | 72 61 6d 65 77 6f 72 6b |de a f|ramework|
|00002790| 20 20 74 6f 20 20 65 76 | 61 6c 75 61 74 65 20 20 | to ev|aluate |
|000027a0| 6e 65 77 0a 58 20 20 20 | 20 20 20 67 75 65 73 73 |new.X | guess|
|000027b0| 65 73 2e 0a 58 0a 58 20 | 20 32 36 2e 20 4b 6e 69 |es..X.X | 26. Kni|
|000027c0| 74 20 62 6c 6f 63 6b 20 | 30 20 74 68 72 6f 75 67 |t block |0 throug|
|000027d0| 68 20 34 20 77 69 74 68 | 20 61 20 6d 69 6e 69 6d |h 4 with| a minim|
|000027e0| 75 6d 20 73 68 6f 77 20 | 6c 65 76 65 6c 20 6f 66 |um show |level of|
|000027f0| 20 32 2e 20 20 59 6f 75 | 20 6d 61 79 20 77 61 6e | 2. You| may wan|
|00002800| 74 0a 58 20 20 20 20 20 | 20 74 6f 20 73 6b 69 70 |t.X | to skip|
|00002810| 20 61 63 63 65 70 74 69 | 6e 67 20 67 75 65 73 73 | accepti|ng guess|
|00002820| 65 73 20 74 68 61 74 20 | 64 6f 20 6e 6f 74 20 64 |es that |do not d|
|00002830| 65 64 75 63 65 20 61 6e | 79 20 63 68 61 72 61 63 |educe an|y charac|
|00002840| 74 65 72 73 2e 20 20 52 | 65 70 65 61 74 0a 58 20 |ters. R|epeat.X |
|00002850| 20 20 20 20 20 74 68 69 | 73 20 70 72 6f 63 65 73 | thi|s proces|
|00002860| 73 20 77 69 74 68 20 61 | 20 73 68 6f 77 20 6c 65 |s with a| show le|
|00002870| 76 65 6c 20 6f 66 20 31 | 2e 0a 58 0a 58 20 20 32 |vel of 1|..X.X 2|
|00002880| 37 2e 20 54 68 65 20 20 | 70 72 6f 67 72 61 6d 20 |7. The |program |
|00002890| 20 73 68 6f 75 6c 64 20 | 20 6e 6f 77 20 20 6b 6e | should | now kn|
|000028a0| 6f 77 20 20 61 6c 6c 20 | 32 35 36 20 77 69 72 69 |ow all |256 wiri|
|000028b0| 6e 67 73 20 6f 66 20 7a | 65 65 2e 20 20 52 65 70 |ngs of z|ee. Rep|
|000028c0| 65 61 74 20 74 68 65 0a | 58 20 20 20 20 20 20 70 |eat the.|X p|
|000028d0| 72 6f 63 65 73 73 20 6f | 66 20 70 72 6f 70 61 67 |rocess o|f propag|
|000028e0| 61 74 69 6e 67 20 69 6e | 66 6f 72 6d 61 74 69 6f |ating in|formatio|
|000028f0| 6e 20 20 62 65 74 77 65 | 65 6e 20 20 62 6c 6f 63 |n betwe|en bloc|
|00002900| 6b 73 20 20 75 6e 74 69 | 6c 20 20 61 6c 6c 20 20 |ks unti|l all |
|00002910| 31 32 38 0a 58 20 20 20 | 20 20 20 77 69 72 65 73 |128.X | wires|
|00002920| 20 6f 66 20 74 68 65 20 | 62 6c 6f 63 6b 20 7a 65 | of the |block ze|
|00002930| 72 6f 20 61 72 65 20 6b | 6e 6f 77 6e 2e 0a 58 0a |ro are k|nown..X.|
|00002940| 58 20 20 32 38 2e 20 53 | 61 76 65 20 20 79 6f 75 |X 28. S|ave you|
|00002950| 72 20 20 77 6f 72 6b 20 | 20 77 69 74 68 20 74 68 |r work | with th|
|00002960| 65 20 73 61 76 65 2d 70 | 65 72 6d 75 74 61 74 69 |e save-p|ermutati|
|00002970| 6f 6e 73 20 63 6f 6d 6d | 61 6e 64 20 28 6f 6e 20 |ons comm|and (on |
|00002980| 74 68 65 20 63 6f 6d 6d | 61 6e 64 0a 58 20 20 20 |the comm|and.X |
|00002990| 20 20 20 6c 69 6e 65 20 | 74 79 70 65 20 27 73 61 | line |type 'sa|
|000029a0| 20 27 20 61 6e 64 20 70 | 72 65 73 73 20 72 65 74 | ' and p|ress ret|
|000029b0| 75 72 6e 29 2e 20 20 54 | 68 69 73 20 77 72 69 74 |urn). T|his writ|
|000029c0| 65 73 20 74 68 65 20 66 | 69 6c 65 20 66 6f 6f 2e |es the f|ile foo.|
|000029d0| 70 65 72 6d 2e 0a 58 0a | 58 20 20 32 39 2e 20 45 |perm..X.|X 29. E|
|000029e0| 78 69 74 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 |xit the |program |
|000029f0| 77 69 74 68 20 74 68 65 | 20 71 75 69 74 20 63 6f |with the| quit co|
|00002a00| 6d 6d 61 6e 64 2e 0a 58 | 0a 58 20 20 33 30 2e 20 |mmand..X|.X 30. |
|00002a10| 43 6f 70 79 20 66 6f 6f | 2e 70 65 72 6d 20 74 6f |Copy foo|.perm to|
|00002a20| 20 7a 65 65 63 6f 64 65 | 2e 70 65 72 6d 2e 0a 58 | zeecode|.perm..X|
|00002a30| 0a 58 20 20 33 31 2e 20 | 45 78 65 63 75 74 65 20 |.X 31. |Execute |
|00002a40| 27 7a 65 65 63 6f 64 65 | 20 3c 20 66 6f 6f 2e 63 |'zeecode| < foo.c|
|00002a50| 69 70 68 65 72 20 7c 20 | 6d 6f 72 65 20 27 2e 20 |ipher | |more '. |
|00002a60| 20 54 68 69 73 20 20 70 | 72 6f 67 72 61 6d 20 20 | This p|rogram |
|00002a70| 72 65 61 64 73 20 20 43 | 42 57 27 73 0a 58 20 20 |reads C|BW's.X |
|00002a80| 20 20 20 20 73 61 76 65 | 20 20 66 69 6c 65 20 20 | save| file |
|00002a90| 74 6f 20 20 66 69 6e 64 | 20 20 74 68 65 20 20 70 |to find| the p|
|00002aa0| 65 72 6d 75 74 61 74 69 | 6f 6e 20 20 66 6f 72 20 |ermutati|on for |
|00002ab0| 20 62 6c 6f 63 6b 20 20 | 7a 65 72 6f 20 61 6e 64 | block |zero and|
|00002ac0| 20 74 68 65 20 5a 65 65 | 0a 58 20 20 20 20 20 20 | the Zee|.X |
|00002ad0| 70 65 72 6d 75 74 61 74 | 69 6f 6e 20 20 74 68 61 |permutat|ion tha|
|00002ae0| 74 20 20 64 65 73 63 72 | 69 62 65 73 20 20 68 6f |t descr|ibes ho|
|00002af0| 77 20 20 74 68 65 20 20 | 72 65 6d 61 69 6e 69 6e |w the |remainin|
|00002b00| 67 20 20 62 6c 6f 63 6b | 20 20 6b 65 79 73 20 20 |g block| keys |
|00002b10| 20 61 72 65 0a 58 20 20 | 20 20 20 20 67 65 6e 65 | are.X | gene|
|00002b20| 72 61 74 65 64 2e 20 20 | 20 20 55 73 69 6e 67 20 |rated. | Using |
|00002b30| 20 74 68 69 73 20 20 69 | 6e 66 6f 72 6d 61 74 69 | this i|nformati|
|00002b40| 6f 6e 20 69 74 20 64 65 | 63 6f 64 65 73 20 73 74 |on it de|codes st|
|00002b50| 61 6e 64 61 72 64 20 69 | 6e 70 75 74 20 61 6e 64 |andard i|nput and|
|00002b60| 0a 58 20 20 20 20 20 20 | 77 72 69 74 65 73 20 6f |.X |writes o|
|00002b70| 6e 20 73 74 61 6e 64 61 | 72 64 20 6f 75 74 70 75 |n standa|rd outpu|
|00002b80| 74 2e 0a 58 0a 58 20 20 | 33 32 2e 20 54 68 61 74 |t..X.X |32. That|
|00002b90| 27 73 20 61 6c 6c 2e 0a | 45 4e 44 5f 4f 46 5f 52 |'s all..|END_OF_R|
|00002ba0| 65 61 64 2e 6d 65 0a 69 | 66 20 74 65 73 74 20 39 |ead.me.i|f test 9|
|00002bb0| 37 39 33 20 2d 6e 65 20 | 60 77 63 20 2d 63 20 3c |793 -ne |`wc -c <|
|00002bc0| 52 65 61 64 2e 6d 65 60 | 3b 20 74 68 65 6e 0a 20 |Read.me`|; then. |
|00002bd0| 20 20 20 65 63 68 6f 20 | 73 68 61 72 3a 20 5c 22 | echo |shar: \"|
|00002be0| 52 65 61 64 2e 6d 65 5c | 22 20 75 6e 70 61 63 6b |Read.me\|" unpack|
|00002bf0| 65 64 20 77 69 74 68 20 | 77 72 6f 6e 67 20 73 69 |ed with |wrong si|
|00002c00| 7a 65 21 0a 66 69 0a 23 | 20 65 6e 64 20 6f 66 20 |ze!.fi.#| end of |
|00002c10| 6f 76 65 72 77 72 69 74 | 69 6e 67 20 63 68 65 63 |overwrit|ing chec|
|00002c20| 6b 0a 66 69 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |k.fi.if |test -f |
|00002c30| 63 69 70 68 65 72 2e 63 | 20 2d 61 20 22 24 7b 31 |cipher.c| -a "${1|
|00002c40| 7d 22 20 21 3d 20 22 2d | 63 22 20 3b 20 74 68 65 |}" != "-|c" ; the|
|00002c50| 6e 20 0a 20 20 65 63 68 | 6f 20 73 68 61 72 3a 20 |n . ech|o shar: |
|00002c60| 57 69 6c 6c 20 6e 6f 74 | 20 6f 76 65 72 2d 77 72 |Will not| over-wr|
|00002c70| 69 74 65 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ite exis|ting fil|
|00002c80| 65 20 5c 22 63 69 70 68 | 65 72 2e 63 5c 22 0a 65 |e \"ciph|er.c\".e|
|00002c90| 6c 73 65 0a 65 63 68 6f | 20 73 68 61 72 3a 20 45 |lse.echo| shar: E|
|00002ca0| 78 74 72 61 63 74 69 6e | 67 20 5c 22 63 69 70 68 |xtractin|g \"ciph|
|00002cb0| 65 72 2e 63 5c 22 20 5c | 28 39 36 34 31 20 63 68 |er.c\" \|(9641 ch|
|00002cc0| 61 72 61 63 74 65 72 73 | 5c 29 0a 73 65 64 20 22 |aracters|\).sed "|
|00002cd0| 73 2f 5e 58 2f 2f 22 20 | 3e 63 69 70 68 65 72 2e |s/^X//" |>cipher.|
|00002ce0| 63 20 3c 3c 27 45 4e 44 | 5f 4f 46 5f 63 69 70 68 |c <<'END|_OF_ciph|
|00002cf0| 65 72 2e 63 27 0a 58 2f | 2a 20 0a 58 20 2a 20 52 |er.c'.X/|* .X * R|
|00002d00| 6f 75 74 69 6e 65 73 20 | 66 6f 72 20 6f 70 65 72 |outines |for oper|
|00002d10| 61 74 69 6e 67 20 6f 6e | 20 63 69 70 68 65 72 20 |ating on| cipher |
|00002d20| 62 6c 6f 63 6b 73 2e 0a | 58 20 2a 0a 58 20 2a 20 |blocks..|X *.X * |
|00002d30| 52 6f 62 65 72 74 20 57 | 2e 20 42 61 6c 64 77 69 |Robert W|. Baldwi|
|00002d40| 6e 2c 20 4a 61 6e 75 61 | 72 79 20 31 39 38 35 2e |n, Janua|ry 1985.|
|00002d50| 0a 58 20 2a 2f 0a 58 0a | 58 0a 58 23 69 6e 63 6c |.X */.X.|X.X#incl|
|00002d60| 75 64 65 09 3c 73 74 64 | 69 6f 2e 68 3e 0a 58 23 |ude.<std|io.h>.X#|
|00002d70| 69 6e 63 6c 75 64 65 09 | 3c 6d 61 74 68 2e 68 3e |include.|<math.h>|
|00002d80| 0a 58 23 69 6e 63 6c 75 | 64 65 09 22 77 69 6e 64 |.X#inclu|de."wind|
|00002d90| 6f 77 2e 68 22 0a 58 23 | 69 6e 63 6c 75 64 65 09 |ow.h".X#|include.|
|00002da0| 22 73 70 65 63 73 2e 68 | 22 0a 58 23 69 6e 63 6c |"specs.h|".X#incl|
|00002db0| 75 64 65 09 22 63 69 70 | 68 65 72 2e 68 22 0a 58 |ude."cip|her.h".X|
|00002dc0| 0a 58 0a 58 23 64 65 66 | 69 6e 65 09 44 45 42 55 |.X.X#def|ine.DEBU|
|00002dd0| 47 09 46 41 4c 53 45 0a | 58 0a 58 0a 58 2f 2a 20 |G.FALSE.|X.X.X/* |
|00002de0| 44 65 63 6f 64 65 20 74 | 68 65 20 63 62 6c 6f 63 |Decode t|he cbloc|
|00002df0| 6b 20 69 6e 74 6f 20 70 | 62 6c 6f 63 6b 20 75 73 |k into p|block us|
|00002e00| 69 6e 67 20 70 65 72 6d | 2e 0a 58 20 2a 20 52 65 |ing perm|..X * Re|
|00002e10| 74 75 72 6e 20 46 41 4c | 53 45 20 69 66 20 66 69 |turn FAL|SE if fi|
|00002e20| 6e 64 20 61 20 6e 6f 6e | 2d 61 73 63 69 69 20 63 |nd a non|-ascii c|
|00002e30| 68 61 72 61 63 74 65 72 | 2c 20 65 6c 73 65 20 31 |haracter|, else 1|
|00002e40| 2e 0a 58 20 2a 2f 0a 58 | 64 65 63 6f 64 65 28 63 |..X */.X|decode(c|
|00002e50| 62 6c 6f 63 6b 2c 20 70 | 62 6c 6f 63 6b 2c 20 70 |block, p|block, p|
|00002e60| 65 72 6d 29 0a 58 63 68 | 61 72 09 63 62 6c 6f 63 |erm).Xch|ar.cbloc|
|00002e70| 6b 5b 5d 3b 0a 58 69 6e | 74 09 09 70 62 6c 6f 63 |k[];.Xin|t..pbloc|
|00002e80| 6b 5b 5d 3b 0a 58 69 6e | 74 09 09 70 65 72 6d 5b |k[];.Xin|t..perm[|
|00002e90| 5d 3b 0a 58 7b 0a 58 69 | 6e 74 20 69 70 6c 61 63 |];.X{.Xi|nt iplac|
|00002ea0| 65 3b 09 09 2f 2a 20 49 | 6e 64 65 78 20 69 6e 74 |e;../* I|ndex int|
|00002eb0| 6f 20 63 69 70 68 65 72 | 74 65 78 74 20 62 6c 6f |o cipher|text blo|
|00002ec0| 63 6b 2e 20 2a 2f 0a 58 | 69 6e 74 20 73 70 63 68 |ck. */.X|int spch|
|00002ed0| 61 72 3b 09 09 2f 2a 20 | 50 6c 61 69 6e 74 65 78 |ar;../* |Plaintex|
|00002ee0| 74 20 63 68 61 72 20 6e | 6f 74 20 75 6e 73 68 69 |t char n|ot unshi|
|00002ef0| 66 74 65 64 2e 20 2a 2f | 0a 58 69 6e 74 20 70 63 |fted. */|.Xint pc|
|00002f00| 68 61 72 3b 09 09 2f 2a | 20 50 6c 61 69 6e 74 65 |har;../*| Plainte|
|00002f10| 78 74 20 63 68 61 72 2e | 20 2a 2f 0a 58 69 6e 74 |xt char.| */.Xint|
|00002f20| 09 67 6f 6f 64 3b 09 09 | 2f 2a 20 50 6c 61 69 6e |.good;..|/* Plain|
|00002f30| 74 65 78 74 20 64 6f 65 | 73 6e 27 74 20 68 61 76 |text doe|sn't hav|
|00002f40| 65 20 61 6e 79 20 75 6e | 61 63 63 65 70 74 61 62 |e any un|acceptab|
|00002f50| 6c 65 20 63 68 61 72 73 | 20 69 6e 20 69 74 2e 20 |le chars| in it. |
|00002f60| 2a 2f 0a 58 0a 58 67 6f | 6f 64 20 3d 20 54 52 55 |*/.X.Xgo|od = TRU|
|00002f70| 45 3b 0a 58 66 6f 72 20 | 28 69 70 6c 61 63 65 20 |E;.Xfor |(iplace |
|00002f80| 3d 20 30 20 3b 20 69 70 | 6c 61 63 65 20 3c 20 42 |= 0 ; ip|lace < B|
|00002f90| 4c 4f 43 4b 53 49 5a 45 | 20 3b 20 69 70 6c 61 63 |LOCKSIZE| ; iplac|
|00002fa0| 65 2b 2b 29 20 7b 0a 58 | 09 73 70 63 68 61 72 20 |e++) {.X|.spchar |
|00002fb0| 3d 20 70 65 72 6d 5b 28 | 69 70 6c 61 63 65 2b 63 |= perm[(|iplace+c|
|00002fc0| 62 6c 6f 63 6b 5b 69 70 | 6c 61 63 65 5d 29 26 4d |block[ip|lace])&M|
|00002fd0| 4f 44 4d 41 53 4b 5d 3b | 0a 58 09 69 66 20 28 73 |ODMASK];|.X.if (s|
|00002fe0| 70 63 68 61 72 20 3d 3d | 20 2d 31 29 20 7b 0a 58 |pchar ==| -1) {.X|
|00002ff0| 09 09 70 63 68 61 72 20 | 3d 20 2d 31 3b 0a 58 09 |..pchar |= -1;.X.|
|00003000| 09 7d 0a 58 09 65 6c 73 | 65 20 7b 0a 58 09 09 70 |.}.X.els|e {.X..p|
|00003010| 63 68 61 72 20 3d 20 28 | 73 70 63 68 61 72 2d 69 |char = (|spchar-i|
|00003020| 70 6c 61 63 65 29 20 26 | 20 4d 4f 44 4d 41 53 4b |place) &| MODMASK|
|00003030| 3b 0a 58 09 09 69 66 20 | 28 6e 6f 74 61 73 63 69 |;.X..if |(notasci|
|00003040| 69 28 70 63 68 61 72 29 | 29 20 20 7b 0a 58 09 09 |i(pchar)|) {.X..|
|00003050| 09 67 6f 6f 64 20 3d 20 | 46 41 4c 53 45 3b 0a 58 |.good = |FALSE;.X|
|00003060| 09 09 09 7d 0a 58 09 09 | 7d 0a 58 09 70 62 6c 6f |...}.X..|}.X.pblo|
|00003070| 63 6b 5b 69 70 6c 61 63 | 65 5d 20 3d 20 70 63 68 |ck[iplac|e] = pch|
|00003080| 61 72 3b 0a 58 09 7d 0a | 58 72 65 74 75 72 6e 28 |ar;.X.}.|Xreturn(|
|00003090| 67 6f 6f 64 29 3b 0a 58 | 7d 0a 58 0a 58 0a 58 2f |good);.X|}.X.X.X/|
|000030a0| 2a 20 53 65 61 72 63 68 | 65 73 20 66 6f 72 20 73 |* Search|es for s|
|000030b0| 74 72 69 6e 67 20 69 6e | 20 62 6c 6f 63 6b 2e 0a |tring in| block..|
|000030c0| 58 20 2a 20 52 65 74 75 | 72 6e 73 20 70 6f 73 69 |X * Retu|rns posi|
|000030d0| 74 69 6f 6e 20 69 74 20 | 66 6f 75 6e 64 20 74 68 |tion it |found th|
|000030e0| 61 74 20 64 69 64 6e 27 | 74 20 68 61 76 65 20 63 |at didn'|t have c|
|000030f0| 6f 6e 66 6c 69 63 74 73 | 2c 20 6f 72 20 2d 31 2e |onflicts|, or -1.|
|00003100| 0a 58 20 2a 20 49 66 20 | 66 6f 75 6e 64 2c 20 69 |.X * If |found, i|
|00003110| 74 20 77 69 6c 6c 20 61 | 64 64 20 74 6f 20 70 65 |t will a|dd to pe|
|00003120| 72 6d 20 61 6c 6c 20 74 | 68 65 20 64 65 64 75 63 |rm all t|he deduc|
|00003130| 65 64 20 77 69 72 69 6e | 67 73 2e 0a 58 20 2a 20 |ed wirin|gs..X * |
|00003140| 49 66 20 70 65 72 6d 20 | 69 73 20 6e 6f 74 20 69 |If perm |is not i|
|00003150| 6e 69 74 69 61 6c 6c 79 | 20 61 6c 6c 20 2d 31 2c |nitially| all -1,|
|00003160| 20 73 65 61 72 63 68 20 | 77 69 6c 6c 20 6e 6f 74 | search |will not|
|00003170| 20 61 63 63 65 70 74 20 | 61 6e 79 0a 58 20 2a 20 | accept |any.X * |
|00003180| 70 6f 73 69 74 69 6f 6e | 20 74 68 61 74 20 63 6f |position| that co|
|00003190| 6e 66 6c 69 63 74 73 20 | 77 69 74 68 20 74 68 65 |nflicts |with the|
|000031a0| 20 69 6e 69 74 69 61 6c | 20 77 69 72 69 6e 67 73 | initial| wirings|
|000031b0| 2c 20 6e 6f 72 20 77 69 | 6c 6c 0a 58 20 2a 20 69 |, nor wi|ll.X * i|
|000031c0| 74 20 6d 75 74 61 74 65 | 20 61 6e 79 20 6f 66 20 |t mutate| any of |
|000031d0| 74 68 6f 73 65 20 77 69 | 72 69 6e 67 73 2e 0a 58 |those wi|rings..X|
|000031e0| 20 2a 2f 0a 58 69 6e 74 | 09 73 65 61 72 63 68 28 | */.Xint|.search(|
|000031f0| 63 69 70 68 65 72 2c 20 | 70 65 72 6d 2c 20 69 6e |cipher, |perm, in|
|00003200| 69 74 70 6f 73 2c 20 74 | 68 69 6e 67 29 0a 58 63 |itpos, t|hing).Xc|
|00003210| 68 61 72 09 2a 63 69 70 | 68 65 72 3b 0a 58 69 6e |har.*cip|her;.Xin|
|00003220| 74 09 09 2a 70 65 72 6d | 3b 0a 58 69 6e 74 09 09 |t..*perm|;.Xint..|
|00003230| 69 6e 69 74 70 6f 73 3b | 0a 58 63 68 61 72 09 2a |initpos;|.Xchar.*|
|00003240| 74 68 69 6e 67 3b 09 09 | 2f 2a 20 4e 55 4c 4c 20 |thing;..|/* NULL |
|00003250| 74 65 72 6d 69 6e 61 74 | 65 64 20 73 74 72 69 6e |terminat|ed strin|
|00003260| 67 2e 20 2a 2f 0a 58 7b | 0a 58 09 69 6e 74 09 69 |g. */.X{|.X.int.i|
|00003270| 70 6c 61 63 65 3b 09 09 | 2f 2a 20 43 75 72 72 65 |place;..|/* Curre|
|00003280| 6e 74 20 70 6c 61 63 65 | 6d 65 6e 74 20 6f 66 20 |nt place|ment of |
|00003290| 74 72 69 67 72 61 6d 20 | 69 6e 20 70 6c 61 69 6e |trigram |in plain|
|000032a0| 74 65 78 74 20 62 6c 6f | 63 6b 2e 20 2a 2f 0a 58 |text blo|ck. */.X|
|000032b0| 09 69 6e 74 20 69 3b 09 | 09 09 2f 2a 20 49 6e 64 |.int i;.|../* Ind|
|000032c0| 65 78 20 66 6f 72 20 69 | 6e 69 74 69 61 6c 69 7a |ex for i|nitializ|
|000032d0| 69 6e 67 20 61 72 72 61 | 79 73 2e 20 2a 2f 0a 58 |ing arra|ys. */.X|
|000032e0| 09 69 6e 74 09 70 63 68 | 61 72 3b 09 09 2f 2a 20 |.int.pch|ar;../* |
|000032f0| 50 6c 61 69 6e 74 65 78 | 74 20 63 68 61 72 61 63 |Plaintex|t charac|
|00003300| 74 65 72 2e 20 2a 2f 0a | 58 09 69 6e 74 09 73 70 |ter. */.|X.int.sp|
|00003310| 63 68 61 72 3b 09 09 2f | 2a 20 50 6c 61 69 6e 74 |char;../|* Plaint|
|00003320| 65 78 74 20 63 68 61 72 | 61 63 74 65 72 20 63 79 |ext char|acter cy|
|00003330| 63 6c 69 63 61 6c 6c 79 | 20 73 68 69 66 74 65 64 |clically| shifted|
|00003340| 20 62 79 20 69 74 73 20 | 70 6f 73 2e 20 2a 2f 0a | by its |pos. */.|
|00003350| 58 09 69 6e 74 09 2a 73 | 70 73 74 6b 70 3b 0a 58 |X.int.*s|pstkp;.X|
|00003360| 09 69 6e 74 09 73 70 73 | 74 61 63 6b 5b 42 4c 4f |.int.sps|tack[BLO|
|00003370| 43 4b 53 49 5a 45 5d 3b | 0a 58 09 69 6e 74 09 2a |CKSIZE];|.X.int.*|
|00003380| 73 63 73 74 6b 70 3b 0a | 58 09 69 6e 74 09 73 63 |scstkp;.|X.int.sc|
|00003390| 73 74 61 63 6b 5b 42 4c | 4f 43 4b 53 49 5a 45 5d |stack[BL|OCKSIZE]|
|000033a0| 3b 0a 58 09 69 6e 74 09 | 73 63 63 68 61 72 3b 09 |;.X.int.|scchar;.|
|000033b0| 09 2f 2a 20 43 69 70 68 | 65 72 74 65 78 74 20 63 |./* Ciph|ertext c|
|000033c0| 68 61 72 61 63 74 65 72 | 20 63 79 63 6c 69 63 61 |haracter| cyclica|
|000033d0| 6c 6c 79 20 73 68 69 66 | 74 65 64 20 62 79 20 69 |lly shif|ted by i|
|000033e0| 74 73 20 70 6f 73 2e 20 | 2a 2f 0a 58 09 69 6e 74 |ts pos. |*/.X.int|
|000033f0| 09 6f 66 66 73 65 74 3b | 0a 58 09 69 6e 74 09 74 |.offset;|.X.int.t|
|00003400| 68 69 6e 67 6c 65 6e 3b | 0a 58 09 63 68 61 72 20 |hinglen;|.X.char |
|00003410| 2a 70 3b 0a 58 0a 58 09 | 70 20 3d 20 74 68 69 6e |*p;.X.X.|p = thin|
|00003420| 67 3b 0a 58 09 66 6f 72 | 20 28 74 68 69 6e 67 6c |g;.X.for| (thingl|
|00003430| 65 6e 20 3d 20 30 20 3b | 20 2a 70 2b 2b 20 21 3d |en = 0 ;| *p++ !=|
|00003440| 20 30 20 3b 20 74 68 69 | 6e 67 6c 65 6e 2b 2b 29 | 0 ; thi|nglen++)|
|00003450| 20 3b 0a 58 0a 58 20 20 | 66 6f 72 20 28 69 70 6c | ;.X.X |for (ipl|
|00003460| 61 63 65 20 3d 20 69 6e | 69 74 70 6f 73 20 3b 20 |ace = in|itpos ; |
|00003470| 69 70 6c 61 63 65 20 3c | 20 42 4c 4f 43 4b 53 49 |iplace <| BLOCKSI|
|00003480| 5a 45 2d 74 68 69 6e 67 | 6c 65 6e 20 3b 20 69 70 |ZE-thing|len ; ip|
|00003490| 6c 61 63 65 2b 2b 29 20 | 7b 0a 58 09 73 70 73 74 |lace++) |{.X.spst|
|000034a0| 6b 70 20 3d 20 73 70 73 | 74 61 63 6b 3b 0a 58 09 |kp = sps|tack;.X.|
|000034b0| 73 63 73 74 6b 70 20 3d | 20 73 63 73 74 61 63 6b |scstkp =| scstack|
|000034c0| 3b 0a 58 09 66 6f 72 20 | 28 6f 66 66 73 65 74 20 |;.X.for |(offset |
|000034d0| 3d 20 30 20 3b 20 6f 66 | 66 73 65 74 20 3c 20 74 |= 0 ; of|fset < t|
|000034e0| 68 69 6e 67 6c 65 6e 20 | 3b 20 6f 66 66 73 65 74 |hinglen |; offset|
|000034f0| 2b 2b 29 20 7b 0a 58 09 | 09 70 63 68 61 72 20 3d |++) {.X.|.pchar =|
|00003500| 20 28 28 69 6e 74 29 20 | 74 68 69 6e 67 5b 6f 66 | ((int) |thing[of|
|00003510| 66 73 65 74 5d 29 3b 0a | 58 09 09 73 70 63 68 61 |fset]);.|X..spcha|
|00003520| 72 20 3d 20 28 70 63 68 | 61 72 20 2b 20 69 70 6c |r = (pch|ar + ipl|
|00003530| 61 63 65 20 2b 20 6f 66 | 66 73 65 74 29 20 26 20 |ace + of|fset) & |
|00003540| 4d 4f 44 4d 41 53 4b 3b | 0a 58 09 09 73 63 63 68 |MODMASK;|.X..scch|
|00003550| 61 72 20 3d 20 28 63 69 | 70 68 65 72 5b 69 70 6c |ar = (ci|pher[ipl|
|00003560| 61 63 65 20 2b 20 6f 66 | 66 73 65 74 5d 20 2b 20 |ace + of|fset] + |
|00003570| 69 70 6c 61 63 65 20 2b | 20 6f 66 66 73 65 74 29 |iplace +| offset)|
|00003580| 20 26 20 4d 4f 44 4d 41 | 53 4b 3b 0a 58 09 09 69 | & MODMA|SK;.X..i|
|00003590| 66 20 28 28 70 65 72 6d | 5b 73 70 63 68 61 72 5d |f ((perm|[spchar]|
|000035a0| 20 21 3d 20 2d 31 20 20 | 7c 7c 20 20 70 65 72 6d | != -1 ||| perm|
|000035b0| 5b 73 63 63 68 61 72 5d | 20 21 3d 20 2d 31 29 0a |[scchar]| != -1).|
|000035c0| 58 09 09 20 26 26 20 28 | 70 65 72 6d 5b 73 70 63 |X.. && (|perm[spc|
|000035d0| 68 61 72 5d 20 21 3d 20 | 73 63 63 68 61 72 29 29 |har] != |scchar))|
|000035e0| 20 20 7b 0a 58 09 09 09 | 09 77 68 69 6c 65 20 28 | {.X...|.while (|
|000035f0| 73 70 73 74 6b 70 20 3e | 20 26 73 70 73 74 61 63 |spstkp >| &spstac|
|00003600| 6b 5b 30 5d 29 20 70 65 | 72 6d 5b 2a 28 2d 2d 73 |k[0]) pe|rm[*(--s|
|00003610| 70 73 74 6b 70 29 5d 20 | 3d 20 2d 31 3b 0a 58 09 |pstkp)] |= -1;.X.|
|00003620| 09 09 09 77 68 69 6c 65 | 20 28 73 63 73 74 6b 70 |...while| (scstkp|
|00003630| 20 3e 20 26 73 63 73 74 | 61 63 6b 5b 30 5d 29 20 | > &scst|ack[0]) |
|00003640| 70 65 72 6d 5b 2a 28 2d | 2d 73 63 73 74 6b 70 29 |perm[*(-|-scstkp)|
|00003650| 5d 20 3d 20 2d 31 3b 0a | 58 09 09 09 09 67 6f 74 |] = -1;.|X....got|
|00003660| 6f 20 6e 65 78 74 70 6c | 61 63 65 3b 0a 58 09 09 |o nextpl|ace;.X..|
|00003670| 09 09 7d 0a 58 09 09 70 | 65 72 6d 5b 73 70 63 68 |..}.X..p|erm[spch|
|00003680| 61 72 5d 20 3d 20 73 63 | 63 68 61 72 3b 0a 58 09 |ar] = sc|char;.X.|
|00003690| 09 2a 73 70 73 74 6b 70 | 2b 2b 20 3d 20 73 70 63 |.*spstkp|++ = spc|
|000036a0| 68 61 72 3b 0a 58 09 09 | 70 65 72 6d 5b 73 63 63 |har;.X..|perm[scc|
|000036b0| 68 61 72 5d 20 3d 20 73 | 70 63 68 61 72 3b 0a 58 |har] = s|pchar;.X|
|000036c0| 09 09 2a 73 63 73 74 6b | 70 2b 2b 20 3d 20 73 63 |..*scstk|p++ = sc|
|000036d0| 63 68 61 72 3b 0a 58 09 | 09 7d 0a 58 09 72 65 74 |char;.X.|.}.X.ret|
|000036e0| 75 72 6e 28 69 70 6c 61 | 63 65 29 3b 0a 58 09 6e |urn(ipla|ce);.X.n|
|000036f0| 65 78 74 70 6c 61 63 65 | 3a 20 3b 0a 58 09 7d 0a |extplace|: ;.X.}.|
|00003700| 58 20 20 72 65 74 75 72 | 6e 28 2d 31 29 3b 0a 58 |X retur|n(-1);.X|
|00003710| 7d 0a 58 0a 58 0a 58 2f | 2a 20 46 69 6c 6c 20 69 |}.X.X.X/|* Fill i|
|00003720| 6e 20 74 68 65 20 70 76 | 65 63 20 77 69 74 68 20 |n the pv|ec with |
|00003730| 74 68 65 20 63 68 61 72 | 61 63 74 65 72 73 20 64 |the char|acters d|
|00003740| 65 63 6f 64 65 64 20 66 | 72 6f 6d 20 61 73 73 75 |ecoded f|rom assu|
|00003750| 6d 69 6e 67 0a 58 20 2a | 20 74 68 61 74 20 74 68 |ming.X *| that th|
|00003760| 65 20 63 69 70 68 65 72 | 74 65 78 74 20 63 68 61 |e cipher|text cha|
|00003770| 72 61 63 74 65 72 20 61 | 74 20 70 6f 73 69 74 69 |racter a|t positi|
|00003780| 6f 6e 20 66 69 72 73 74 | 70 6f 73 20 6d 61 70 73 |on first|pos maps|
|00003790| 20 74 6f 0a 58 20 2a 20 | 74 68 65 20 70 6c 61 69 | to.X * |the plai|
|000037a0| 6e 74 65 78 74 20 63 68 | 61 72 61 63 74 65 72 20 |ntext ch|aracter |
|000037b0| 66 69 72 73 74 70 6c 61 | 69 6e 2e 0a 58 20 2a 20 |firstpla|in..X * |
|000037c0| 52 65 74 75 72 6e 20 74 | 68 65 20 6e 75 6d 62 65 |Return t|he numbe|
|000037d0| 72 20 6f 66 20 63 68 61 | 72 61 63 74 65 72 73 20 |r of cha|racters |
|000037e0| 61 64 64 65 64 20 74 6f | 20 70 76 65 63 20 6e 6f |added to| pvec no|
|000037f0| 74 20 63 6f 75 6e 74 69 | 6e 67 0a 58 20 2a 20 74 |t counti|ng.X * t|
|00003800| 68 65 20 74 65 72 6d 69 | 6e 61 74 69 6f 6e 20 63 |he termi|nation c|
|00003810| 68 61 72 61 63 74 65 72 | 20 28 4e 4f 4e 45 29 20 |haracter| (NONE) |
|00003820| 74 68 61 74 20 77 65 20 | 61 6c 77 61 79 73 20 61 |that we |always a|
|00003830| 64 64 2e 0a 58 20 2a 20 | 49 66 20 61 6e 79 20 6f |dd..X * |If any o|
|00003840| 66 20 74 68 65 20 63 68 | 61 72 61 63 65 72 73 20 |f the ch|aracers |
|00003850| 64 65 63 6f 64 65 64 20 | 74 6f 20 6e 6f 6e 2d 61 |decoded |to non-a|
|00003860| 73 63 69 69 20 76 61 6c | 75 65 73 2c 20 74 68 65 |scii val|ues, the|
|00003870| 6e 0a 58 20 2a 20 72 65 | 74 75 72 6e 20 45 52 52 |n.X * re|turn ERR|
|00003880| 4f 52 20 28 61 20 6e 65 | 67 61 74 69 76 65 20 6e |OR (a ne|gative n|
|00003890| 75 6d 62 65 72 29 2e 0a | 58 20 2a 20 41 6c 73 6f |umber)..|X * Also|
|000038a0| 20 72 65 74 75 72 6e 20 | 45 52 52 4f 52 20 69 66 | return |ERROR if|
|000038b0| 20 74 68 65 20 67 75 65 | 73 73 20 77 6f 75 6c 64 | the gue|ss would|
|000038c0| 20 63 6f 6e 66 6c 69 63 | 74 20 77 69 74 68 20 74 | conflic|t with t|
|000038d0| 68 65 20 6f 6e 65 73 20 | 61 6c 72 65 61 64 79 0a |he ones |already.|
|000038e0| 58 20 2a 20 69 6e 20 65 | 63 69 2d 3e 70 65 72 6d |X * in e|ci->perm|
|000038f0| 2e 0a 58 20 2a 2f 0a 58 | 69 6e 74 09 64 65 63 6f |..X */.X|int.deco|
|00003900| 64 65 5f 63 6c 61 73 73 | 28 65 63 69 2c 20 66 69 |de_class|(eci, fi|
|00003910| 72 73 74 70 6f 73 2c 20 | 66 69 72 73 74 70 6c 61 |rstpos, |firstpla|
|00003920| 69 6e 2c 20 70 76 65 63 | 29 0a 58 65 63 69 6e 66 |in, pvec|).Xecinf|
|00003930| 6f 09 2a 65 63 69 3b 0a | 58 69 6e 74 09 09 66 69 |o.*eci;.|Xint..fi|
|00003940| 72 73 74 70 6f 73 3b 0a | 58 69 6e 74 09 09 66 69 |rstpos;.|Xint..fi|
|00003950| 72 73 74 70 6c 61 69 6e | 3b 0a 58 69 6e 74 09 09 |rstplain|;.Xint..|
|00003960| 2a 70 76 65 63 3b 0a 58 | 7b 0a 58 09 69 6e 74 09 |*pvec;.X|{.X.int.|
|00003970| 09 78 2c 79 3b 0a 58 0a | 58 09 66 69 72 73 74 70 |.x,y;.X.|X.firstp|
|00003980| 6f 73 20 3d 20 4d 4f 44 | 4d 41 53 4b 20 26 20 66 |os = MOD|MASK & f|
|00003990| 69 72 73 74 70 6f 73 3b | 0a 58 09 66 69 72 73 74 |irstpos;|.X.first|
|000039a0| 70 6c 61 69 6e 20 3d 20 | 43 48 41 52 4d 41 53 4b |plain = |CHARMASK|
|000039b0| 20 26 20 66 69 72 73 74 | 70 6c 61 69 6e 3b 0a 58 | & first|plain;.X|
|000039c0| 0a 58 09 78 20 3d 20 65 | 63 69 2d 3e 73 63 69 70 |.X.x = e|ci->scip|
|000039d0| 68 65 72 5b 66 69 72 73 | 74 70 6f 73 5d 3b 0a 58 |her[firs|tpos];.X|
|000039e0| 09 79 20 3d 20 4d 4f 44 | 4d 41 53 4b 20 26 20 28 |.y = MOD|MASK & (|
|000039f0| 66 69 72 73 74 70 6c 61 | 69 6e 20 2b 20 66 69 72 |firstpla|in + fir|
|00003a00| 73 74 70 6f 73 29 3b 0a | 58 0a 58 09 72 65 74 75 |stpos);.|X.X.retu|
|00003a10| 72 6e 28 64 65 63 6f 64 | 65 5f 77 69 72 65 28 65 |rn(decod|e_wire(e|
|00003a20| 63 69 2c 20 78 2c 20 79 | 2c 20 70 76 65 63 29 29 |ci, x, y|, pvec))|
|00003a30| 3b 0a 58 7d 0a 58 0a 58 | 0a 58 2f 2a 20 46 69 6c |;.X}.X.X|.X/* Fil|
|00003a40| 6c 20 69 6e 20 74 68 65 | 20 70 76 65 63 20 77 69 |l in the| pvec wi|
|00003a50| 74 68 20 74 68 65 20 63 | 68 61 72 61 63 74 65 72 |th the c|haracter|
|00003a60| 73 20 64 65 63 6f 64 65 | 64 20 66 72 6f 6d 20 61 |s decode|d from a|
|00003a70| 73 73 75 6d 69 6e 67 0a | 58 20 2a 20 74 68 61 74 |ssuming.|X * that|
|00003a80| 20 74 68 65 20 70 65 72 | 6d 75 74 61 74 69 6f 6e | the per|mutation|
|00003a90| 20 66 6f 72 20 74 68 69 | 73 20 62 6c 6f 63 6b 20 | for thi|s block |
|00003aa0| 6d 61 70 73 20 78 20 74 | 6f 20 79 20 61 6e 64 20 |maps x t|o y and |
|00003ab0| 76 69 63 65 2d 76 65 72 | 73 61 2e 0a 58 20 2a 20 |vice-ver|sa..X * |
|00003ac0| 52 65 74 75 72 6e 20 74 | 68 65 20 6e 75 6d 62 65 |Return t|he numbe|
|00003ad0| 72 20 6f 66 20 63 68 61 | 72 61 63 74 65 72 73 20 |r of cha|racters |
|00003ae0| 61 64 64 65 64 20 74 6f | 20 70 76 65 63 20 6e 6f |added to| pvec no|
|00003af0| 74 20 63 6f 75 6e 74 69 | 6e 67 0a 58 20 2a 20 74 |t counti|ng.X * t|
|00003b00| 68 65 20 74 65 72 6d 69 | 6e 61 74 69 6f 6e 20 63 |he termi|nation c|
|00003b10| 68 61 72 61 63 74 65 72 | 20 28 4e 4f 4e 45 29 20 |haracter| (NONE) |
|00003b20| 74 68 61 74 20 77 65 20 | 61 6c 77 61 79 73 20 61 |that we |always a|
|00003b30| 64 64 20 28 62 75 74 20 | 6e 6f 74 20 69 66 0a 58 |dd (but |not if.X|
|00003b40| 20 2a 20 77 65 20 72 65 | 74 75 72 6e 20 45 52 52 | * we re|turn ERR|
|00003b50| 4f 52 29 2e 0a 58 20 2a | 20 49 66 20 61 6e 79 20 |OR)..X *| If any |
|00003b60| 6f 66 20 74 68 65 20 63 | 68 61 72 61 63 65 72 73 |of the c|haracers|
|00003b70| 20 64 65 63 6f 64 65 64 | 20 74 6f 20 6e 6f 6e 2d | decoded| to non-|
|00003b80| 61 73 63 69 69 20 76 61 | 6c 75 65 73 2c 20 74 68 |ascii va|lues, th|
|00003b90| 65 6e 0a 58 20 2a 20 72 | 65 74 75 72 6e 20 45 52 |en.X * r|eturn ER|
|00003ba0| 52 4f 52 20 28 61 20 6e | 65 67 61 74 69 76 65 20 |ROR (a n|egative |
|00003bb0| 6e 75 6d 62 65 72 29 2e | 0a 58 20 2a 20 41 6c 73 |number).|.X * Als|
|00003bc0| 6f 20 72 65 74 75 72 6e | 20 45 52 52 4f 52 20 69 |o return| ERROR i|
|00003bd0| 66 20 74 68 65 20 67 75 | 65 73 73 20 77 6f 75 6c |f the gu|ess woul|
|00003be0| 64 20 63 6f 6e 66 6c 69 | 63 74 20 77 69 74 68 20 |d confli|ct with |
|00003bf0| 74 68 65 20 6f 6e 65 73 | 20 61 6c 72 65 61 64 79 |the ones| already|
|00003c00| 0a 58 20 2a 20 69 6e 20 | 65 63 69 2d 3e 70 65 72 |.X * in |eci->per|
|00003c10| 6d 2e 0a 58 20 2a 20 41 | 6c 73 6f 20 72 65 74 75 |m..X * A|lso retu|
|00003c20| 72 6e 20 45 52 52 4f 52 | 20 69 66 20 78 20 3d 3d |rn ERROR| if x ==|
|00003c30| 20 79 2e 0a 58 20 2a 2f | 0a 58 69 6e 74 09 64 65 | y..X */|.Xint.de|
|00003c40| 63 6f 64 65 5f 77 69 72 | 65 28 65 63 69 2c 20 78 |code_wir|e(eci, x|
|00003c50| 2c 20 79 2c 20 70 76 65 | 63 29 0a 58 65 63 69 6e |, y, pve|c).Xecin|
|00003c60| 66 6f 09 2a 65 63 69 3b | 0a 58 69 6e 74 09 09 78 |fo.*eci;|.Xint..x|
|00003c70| 3b 0a 58 69 6e 74 09 09 | 79 3b 0a 58 69 6e 74 09 |;.Xint..|y;.Xint.|
|00003c80| 09 2a 70 76 65 63 3b 0a | 58 7b 0a 58 09 64 65 63 |.*pvec;.|X{.X.dec|
|00003c90| 6f 64 65 5f 77 69 72 65 | 5f 62 75 74 28 65 63 69 |ode_wire|_but(eci|
|00003ca0| 2c 20 78 2c 20 79 2c 20 | 70 76 65 63 2c 20 4e 4f |, x, y, |pvec, NO|
|00003cb0| 4e 45 2c 20 4e 4f 4e 45 | 29 3b 0a 58 7d 0a 58 0a |NE, NONE|);.X}.X.|
|00003cc0| 58 0a 58 2f 2a 20 46 69 | 6c 6c 20 69 6e 20 74 68 |X.X/* Fi|ll in th|
|00003cd0| 65 20 70 76 65 63 20 77 | 69 74 68 20 74 68 65 20 |e pvec w|ith the |
|00003ce0| 63 68 61 72 61 63 74 65 | 72 73 20 64 65 63 6f 64 |characte|rs decod|
|00003cf0| 65 64 20 66 72 6f 6d 20 | 61 73 73 75 6d 69 6e 67 |ed from |assuming|
|00003d00| 0a 58 20 2a 20 74 68 61 | 74 20 74 68 65 20 70 65 |.X * tha|t the pe|
|00003d10| 72 6d 75 74 61 74 69 6f | 6e 20 66 6f 72 20 74 68 |rmutatio|n for th|
|00003d20| 69 73 20 62 6c 6f 63 6b | 20 6d 61 70 73 20 78 20 |is block| maps x |
|00003d30| 74 6f 20 79 20 61 6e 64 | 20 76 69 63 65 2d 76 65 |to y and| vice-ve|
|00003d40| 72 73 61 2e 0a 58 20 2a | 20 52 65 74 75 72 6e 20 |rsa..X *| Return |
|00003d50| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 63 68 |the numb|er of ch|
|00003d60| 61 72 61 63 74 65 72 73 | 20 61 64 64 65 64 20 74 |aracters| added t|
|00003d70| 6f 20 70 76 65 63 20 6e | 6f 74 20 63 6f 75 6e 74 |o pvec n|ot count|
|00003d80| 69 6e 67 0a 58 20 2a 20 | 74 68 65 20 74 65 72 6d |ing.X * |the term|
|00003d90| 69 6e 61 74 69 6f 6e 20 | 63 68 61 72 61 63 74 65 |ination |characte|
|00003da0| 72 20 28 4e 4f 4e 45 29 | 20 74 68 61 74 20 77 65 |r (NONE)| that we|
|00003db0| 20 61 6c 77 61 79 73 20 | 61 64 64 20 28 62 75 74 | always |add (but|
|00003dc0| 20 6e 6f 74 20 69 66 0a | 58 20 2a 20 77 65 20 72 | not if.|X * we r|
|00003dd0| 65 74 75 72 6e 20 45 52 | 52 4f 52 29 2e 0a 58 20 |eturn ER|ROR)..X |
|00003de0| 2a 20 49 66 20 61 6e 79 | 20 6f 66 20 74 68 65 20 |* If any| of the |
|00003df0| 63 68 61 72 61 63 65 72 | 73 20 64 65 63 6f 64 65 |characer|s decode|
|00003e00| 64 20 74 6f 20 6e 6f 6e | 2d 61 73 63 69 69 20 76 |d to non|-ascii v|
|00003e10| 61 6c 75 65 73 2c 20 74 | 68 65 6e 0a 58 20 2a 20 |alues, t|hen.X * |
|00003e20| 72 65 74 75 72 6e 20 45 | 52 52 4f 52 20 28 61 20 |return E|RROR (a |
|00003e30| 6e 65 67 61 74 69 76 65 | 20 6e 75 6d 62 65 72 29 |negative| number)|
|00003e40| 2e 0a 58 20 2a 20 41 6c | 73 6f 20 72 65 74 75 72 |..X * Al|so retur|
|00003e50| 6e 20 45 52 52 4f 52 20 | 69 66 20 74 68 65 20 67 |n ERROR |if the g|
|00003e60| 75 65 73 73 20 77 6f 75 | 6c 64 20 63 6f 6e 66 6c |uess wou|ld confl|
|00003e70| 69 63 74 20 77 69 74 68 | 20 74 68 65 20 6f 6e 65 |ict with| the one|
|00003e80| 73 20 61 6c 72 65 61 64 | 79 0a 58 20 2a 20 69 6e |s alread|y.X * in|
|00003e90| 20 65 63 69 2d 3e 70 65 | 72 6d 2e 0a 58 20 2a 20 | eci->pe|rm..X * |
|00003ea0| 41 6c 73 6f 20 72 65 74 | 75 72 6e 20 45 52 52 4f |Also ret|urn ERRO|
|00003eb0| 52 20 69 66 20 78 20 3d | 3d 20 79 2e 0a 58 20 2a |R if x =|= y..X *|
|00003ec0| 20 44 4f 20 4e 4f 54 20 | 69 6e 63 6c 75 64 65 20 | DO NOT |include |
|00003ed0| 61 6e 79 20 63 68 61 72 | 61 63 74 65 72 73 20 69 |any char|acters i|
|00003ee0| 6e 20 74 68 65 20 70 6f | 73 74 69 6f 6e 73 20 72 |n the po|stions r|
|00003ef0| 61 6e 67 69 6e 67 20 66 | 72 6f 6d 0a 58 20 2a 20 |anging f|rom.X * |
|00003f00| 66 69 72 73 74 20 74 6f | 20 6c 61 73 74 20 69 6e |first to| last in|
|00003f10| 63 6c 75 73 69 76 65 2e | 0a 58 20 2a 2f 0a 58 69 |clusive.|.X */.Xi|
|00003f20| 6e 74 09 64 65 63 6f 64 | 65 5f 77 69 72 65 5f 62 |nt.decod|e_wire_b|
|00003f30| 75 74 28 65 63 69 2c 20 | 78 2c 20 79 2c 20 70 76 |ut(eci, |x, y, pv|
|00003f40| 65 63 2c 20 66 69 72 73 | 74 2c 20 6c 61 73 74 29 |ec, firs|t, last)|
|00003f50| 0a 58 65 63 69 6e 66 6f | 09 2a 65 63 69 3b 0a 58 |.Xecinfo|.*eci;.X|
|00003f60| 69 6e 74 09 09 78 3b 0a | 58 69 6e 74 09 09 79 3b |int..x;.|Xint..y;|
|00003f70| 0a 58 69 6e 74 09 09 2a | 70 76 65 63 3b 0a 58 69 |.Xint..*|pvec;.Xi|
|00003f80| 6e 74 09 09 66 69 72 73 | 74 2c 20 6c 61 73 74 3b |nt..firs|t, last;|
|00003f90| 0a 58 7b 0a 58 09 69 6e | 74 09 09 64 65 6c 74 61 |.X{.X.in|t..delta|
|00003fa0| 3b 0a 58 09 69 6e 74 09 | 09 70 6f 73 2c 20 66 69 |;.X.int.|.pos, fi|
|00003fb0| 72 73 74 66 6c 61 67 3b | 0a 58 09 69 6e 74 09 09 |rstflag;|.X.int..|
|00003fc0| 63 2c 69 3b 0a 58 09 69 | 6e 74 09 09 66 69 72 73 |c,i;.X.i|nt..firs|
|00003fd0| 74 70 6f 73 3b 0a 58 09 | 69 6e 74 09 09 6f 74 68 |tpos;.X.|int..oth|
|00003fe0| 65 72 70 6f 73 3b 0a 58 | 09 69 6e 74 09 09 70 76 |erpos;.X|.int..pv|
|00003ff0| 65 63 69 6e 64 65 78 3b | 0a 58 0a 58 0a 58 09 70 |ecindex;|.X.X.X.p|
|00004000| 76 65 63 69 6e 64 65 78 | 20 3d 20 30 3b 0a 58 09 |vecindex| = 0;.X.|
|00004010| 70 76 65 63 5b 70 76 65 | 63 69 6e 64 65 78 5d 20 |pvec[pve|cindex] |
|00004020| 3d 20 4e 4f 4e 45 3b 0a | 58 09 78 20 3d 20 78 20 |= NONE;.|X.x = x |
|00004030| 26 20 4d 4f 44 4d 41 53 | 4b 3b 0a 58 09 79 20 3d |& MODMAS|K;.X.y =|
|00004040| 20 79 20 26 20 4d 4f 44 | 4d 41 53 4b 3b 0a 58 09 | y & MOD|MASK;.X.|
|00004050| 69 66 20 28 66 69 72 73 | 74 20 3e 20 6c 61 73 74 |if (firs|t > last|
|00004060| 29 20 20 7b 0a 58 09 09 | 70 72 69 6e 74 66 28 22 |) {.X..|printf("|
|00004070| 5c 6e 64 65 63 6f 64 65 | 5f 77 69 72 65 5f 62 75 |\ndecode|_wire_bu|
|00004080| 74 20 63 61 6c 6c 65 64 | 20 77 69 74 68 20 66 69 |t called| with fi|
|00004090| 72 73 74 20 3e 20 6c 61 | 73 74 2e 5c 6e 22 29 3b |rst > la|st.\n");|
|000040a0| 0a 58 09 09 65 78 69 74 | 28 30 29 3b 0a 58 09 09 |.X..exit|(0);.X..|
|000040b0| 7d 0a 58 0a 58 09 69 66 | 20 28 70 65 72 6d 5f 63 |}.X.X.if| (perm_c|
|000040c0| 6f 6e 66 6c 69 63 74 28 | 65 63 69 2d 3e 70 65 72 |onflict(|eci->per|
|000040d0| 6d 2c 78 2c 79 29 20 20 | 7c 7c 20 20 78 20 3d 3d |m,x,y) ||| x ==|
|000040e0| 20 79 29 20 7b 0a 58 23 | 69 66 20 44 45 42 55 47 | y) {.X#|if DEBUG|
|000040f0| 0a 58 09 09 70 72 69 6e | 74 66 28 22 43 41 4e 4e |.X..prin|tf("CANN|
|00004100| 4f 54 20 61 63 63 65 70 | 74 20 74 68 65 20 67 75 |OT accep|t the gu|
|00004110| 65 73 73 20 6f 66 20 25 | 64 20 77 69 72 65 64 20 |ess of %|d wired |
|00004120| 74 6f 20 25 64 2e 5c 6e | 22 2c 0a 58 09 09 09 09 |to %d.\n|",.X....|
|00004130| 78 2c 20 79 29 3b 0a 58 | 23 65 6e 64 69 66 0a 58 |x, y);.X|#endif.X|
|00004140| 09 09 72 65 74 75 72 6e | 28 45 52 52 4f 52 29 3b |..return|(ERROR);|
|00004150| 0a 58 09 09 7d 0a 58 0a | 58 09 66 69 72 73 74 70 |.X..}.X.|X.firstp|
|00004160| 6f 73 20 3d 20 65 63 69 | 2d 3e 70 65 72 6d 6d 61 |os = eci|->permma|
|00004170| 70 5b 78 5d 3b 0a 58 09 | 69 66 20 28 66 69 72 73 |p[x];.X.|if (firs|
|00004180| 74 70 6f 73 20 21 3d 20 | 4e 4f 4e 45 29 20 7b 0a |tpos != |NONE) {.|
|00004190| 58 09 09 64 65 6c 74 61 | 20 3d 20 79 20 2d 20 78 |X..delta| = y - x|
|000041a0| 3b 0a 58 09 09 66 6f 72 | 5f 70 6f 73 5f 69 6e 5f |;.X..for|_pos_in_|
|000041b0| 63 6c 61 73 73 28 70 6f | 73 2c 20 66 69 72 73 74 |class(po|s, first|
|000041c0| 70 6f 73 29 20 7b 0a 58 | 09 09 09 69 66 20 28 66 |pos) {.X|...if (f|
|000041d0| 69 72 73 74 20 3c 3d 20 | 70 6f 73 20 26 26 20 70 |irst <= |pos && p|
|000041e0| 6f 73 20 3c 3d 20 6c 61 | 73 74 29 20 20 63 6f 6e |os <= la|st) con|
|000041f0| 74 69 6e 75 65 3b 0a 58 | 09 09 09 63 20 3d 20 4d |tinue;.X|...c = M|
|00004200| 4f 44 4d 41 53 4b 20 26 | 20 28 65 63 69 2d 3e 73 |ODMASK &| (eci->s|
|00004210| 63 69 70 68 65 72 5b 70 | 6f 73 5d 20 2b 20 64 65 |cipher[p|os] + de|
|00004220| 6c 74 61 20 2d 20 70 6f | 73 29 3b 0a 58 09 09 09 |lta - po|s);.X...|
|00004230| 69 66 20 28 63 20 21 3d | 20 28 63 20 26 20 43 48 |if (c !=| (c & CH|
|00004240| 41 52 4d 41 53 4b 29 29 | 20 20 72 65 74 75 72 6e |ARMASK))| return|
|00004250| 28 45 52 52 4f 52 29 3b | 0a 58 09 09 09 70 76 65 |(ERROR);|.X...pve|
|00004260| 63 5b 70 76 65 63 69 6e | 64 65 78 2b 2b 5d 20 3d |c[pvecin|dex++] =|
|00004270| 20 63 3b 0a 58 09 09 09 | 7d 0a 58 09 09 7d 0a 58 | c;.X...|}.X..}.X|
|00004280| 0a 58 09 6f 74 68 65 72 | 70 6f 73 20 3d 20 65 63 |.X.other|pos = ec|
|00004290| 69 2d 3e 70 65 72 6d 6d | 61 70 5b 79 5d 3b 0a 58 |i->permm|ap[y];.X|
|000042a0| 09 69 66 20 28 6f 74 68 | 65 72 70 6f 73 20 21 3d |.if (oth|erpos !=|
|000042b0| 20 4e 4f 4e 45 29 20 7b | 0a 58 09 09 64 65 6c 74 | NONE) {|.X..delt|
|000042c0| 61 20 3d 20 78 20 2d 20 | 79 3b 0a 58 09 09 66 6f |a = x - |y;.X..fo|
|000042d0| 72 5f 70 6f 73 5f 69 6e | 5f 63 6c 61 73 73 28 70 |r_pos_in|_class(p|
|000042e0| 6f 73 2c 20 6f 74 68 65 | 72 70 6f 73 29 20 7b 0a |os, othe|rpos) {.|
|000042f0| 58 09 09 09 69 66 20 28 | 66 69 72 73 74 20 3c 3d |X...if (|first <=|
|00004300| 20 70 6f 73 20 26 26 20 | 70 6f 73 20 3c 3d 20 6c | pos && |pos <= l|
|00004310| 61 73 74 29 20 20 63 6f | 6e 74 69 6e 75 65 3b 0a |ast) co|ntinue;.|
|00004320| 58 09 09 09 63 20 3d 20 | 4d 4f 44 4d 41 53 4b 20 |X...c = |MODMASK |
|00004330| 26 20 28 65 63 69 2d 3e | 73 63 69 70 68 65 72 5b |& (eci->|scipher[|
|00004340| 70 6f 73 5d 20 2b 20 64 | 65 6c 74 61 20 2d 20 70 |pos] + d|elta - p|
|00004350| 6f 73 29 3b 0a 58 09 09 | 09 69 66 20 28 63 20 21 |os);.X..|.if (c !|
|00004360| 3d 20 28 63 20 26 20 43 | 48 41 52 4d 41 53 4b 29 |= (c & C|HARMASK)|
|00004370| 29 20 20 72 65 74 75 72 | 6e 28 45 52 52 4f 52 29 |) retur|n(ERROR)|
|00004380| 3b 0a 58 09 09 09 70 76 | 65 63 5b 70 76 65 63 69 |;.X...pv|ec[pveci|
|00004390| 6e 64 65 78 2b 2b 5d 20 | 3d 20 63 3b 0a 58 09 09 |ndex++] |= c;.X..|
|000043a0| 09 7d 0a 58 09 09 7d 0a | 58 0a 58 09 70 76 65 63 |.}.X..}.|X.X.pvec|
|000043b0| 5b 70 76 65 63 69 6e 64 | 65 78 5d 20 3d 20 4e 4f |[pvecind|ex] = NO|
|000043c0| 4e 45 3b 0a 58 09 72 65 | 74 75 72 6e 28 70 76 65 |NE;.X.re|turn(pve|
|000043d0| 63 69 6e 64 65 78 29 3b | 0a 58 7d 0a 58 0a 58 0a |cindex);|.X}.X.X.|
|000043e0| 58 0a 58 2f 2a 20 46 69 | 6c 6c 20 69 6e 20 61 6e |X.X/* Fi|ll in an|
|000043f0| 20 69 6e 74 65 72 67 65 | 72 20 62 75 66 66 65 72 | interge|r buffer|
|00004400| 20 66 72 6f 6d 20 74 68 | 65 20 63 68 61 72 61 63 | from th|e charac|
|00004410| 74 65 72 73 20 6f 66 20 | 61 20 62 79 74 65 20 62 |ters of |a byte b|
|00004420| 75 66 66 65 72 2e 0a 58 | 20 2a 20 54 68 65 20 62 |uffer..X| * The b|
|00004430| 75 66 66 65 72 73 20 6d | 75 73 74 20 68 61 76 65 |uffers m|ust have|
|00004440| 20 65 71 75 61 6c 20 6c | 65 6e 67 74 68 73 2e 0a | equal l|engths..|
|00004450| 58 20 2a 2f 0a 58 63 68 | 61 72 32 62 75 66 28 63 |X */.Xch|ar2buf(c|
|00004460| 70 74 72 2c 20 69 70 74 | 72 2c 20 6c 65 6e 67 74 |ptr, ipt|r, lengt|
|00004470| 68 29 0a 58 63 68 61 72 | 09 2a 63 70 74 72 3b 0a |h).Xchar|.*cptr;.|
|00004480| 58 69 6e 74 09 09 2a 69 | 70 74 72 3b 0a 58 69 6e |Xint..*i|ptr;.Xin|
|00004490| 74 09 09 6c 65 6e 67 74 | 68 3b 0a 58 7b 0a 58 09 |t..lengt|h;.X{.X.|
|000044a0| 69 6e 74 09 09 69 3b 0a | 58 0a 58 09 66 6f 72 20 |int..i;.|X.X.for |
|000044b0| 28 69 20 3d 20 30 20 3b | 20 69 20 3c 20 6c 65 6e |(i = 0 ;| i < len|
|000044c0| 67 74 68 20 3b 20 69 2b | 2b 29 20 20 7b 0a 58 09 |gth ; i+|+) {.X.|
|000044d0| 09 2a 69 70 74 72 2b 2b | 20 3d 20 4d 4f 44 4d 41 |.*iptr++| = MODMA|
|000044e0| 53 4b 20 26 20 28 2a 63 | 70 74 72 2b 2b 29 3b 0a |SK & (*c|ptr++);.|
|000044f0| 58 09 09 7d 0a 58 7d 0a | 58 0a 58 0a 58 2f 2a 20 |X..}.X}.|X.X.X/* |
|00004500| 46 69 6c 6c 20 69 6e 20 | 61 20 63 68 61 72 61 63 |Fill in |a charac|
|00004510| 74 65 72 20 62 75 66 66 | 65 72 20 66 72 6f 6d 20 |ter buff|er from |
|00004520| 74 68 65 20 69 6e 74 65 | 67 65 72 73 20 6f 66 20 |the inte|gers of |
|00004530| 61 20 62 79 74 65 20 62 | 75 66 66 65 72 2e 0a 58 |a byte b|uffer..X|
|00004540| 20 2a 20 49 66 20 74 68 | 65 20 69 6e 74 65 67 65 | * If th|e intege|
|00004550| 72 20 76 61 6c 75 65 20 | 69 73 20 4e 4f 4e 45 2c |r value |is NONE,|
|00004560| 20 75 73 65 20 6e 6f 6e | 65 63 68 61 72 20 69 6e | use non|echar in|
|00004570| 73 74 65 61 64 2e 0a 58 | 20 2a 20 54 68 65 20 62 |stead..X| * The b|
|00004580| 75 66 66 65 72 73 20 6d | 75 73 74 20 68 61 76 65 |uffers m|ust have|
|00004590| 20 65 71 75 61 6c 20 6c | 65 6e 67 74 68 73 2e 0a | equal l|engths..|
|000045a0| 58 20 2a 2f 0a 58 62 75 | 66 32 63 68 61 72 28 63 |X */.Xbu|f2char(c|
|000045b0| 70 74 72 2c 20 69 70 74 | 72 2c 20 6c 65 6e 67 74 |ptr, ipt|r, lengt|
|000045c0| 68 2c 20 6e 6f 6e 65 63 | 68 61 72 29 0a 58 63 68 |h, nonec|har).Xch|
|000045d0| 61 72 09 2a 63 70 74 72 | 3b 0a 58 69 6e 74 09 09 |ar.*cptr|;.Xint..|
|000045e0| 2a 69 70 74 72 3b 0a 58 | 69 6e 74 09 09 6c 65 6e |*iptr;.X|int..len|
|000045f0| 67 74 68 3b 0a 58 69 6e | 74 09 09 6e 6f 6e 65 63 |gth;.Xin|t..nonec|
|00004600| 68 61 72 3b 0a 58 7b 0a | 58 09 69 6e 74 09 09 69 |har;.X{.|X.int..i|
|00004610| 3b 0a 58 0a 58 09 66 6f | 72 20 28 69 20 3d 20 30 |;.X.X.fo|r (i = 0|
|00004620| 20 3b 20 69 20 3c 20 6c | 65 6e 67 74 68 20 3b 20 | ; i < l|ength ; |
|00004630| 69 2b 2b 29 20 20 7b 0a | 58 09 09 69 66 20 28 2a |i++) {.|X..if (*|
|00004640| 69 70 74 72 20 21 3d 20 | 4e 4f 4e 45 29 20 20 7b |iptr != |NONE) {|
|00004650| 0a 58 09 09 09 2a 63 70 | 74 72 2b 2b 20 3d 20 4d |.X...*cp|tr++ = M|
|00004660| 4f 44 4d 41 53 4b 20 26 | 20 28 2a 69 70 74 72 2b |ODMASK &| (*iptr+|
|00004670| 2b 29 3b 0a 58 09 09 09 | 7d 0a 58 09 09 65 6c 73 |+);.X...|}.X..els|
|00004680| 65 20 7b 0a 58 09 09 09 | 2a 63 70 74 72 2b 2b 20 |e {.X...|*cptr++ |
|00004690| 3d 20 6e 6f 6e 65 63 68 | 61 72 3b 0a 58 09 09 09 |= nonech|ar;.X...|
|000046a0| 7d 0a 58 09 09 7d 0a 58 | 7d 0a 58 0a 58 0a 58 0a |}.X..}.X|}.X.X.X.|
|000046b0| 58 2f 2a 20 46 69 6c 6c | 20 69 6e 20 61 6e 20 69 |X/* Fill| in an i|
|000046c0| 6e 74 65 72 67 65 72 20 | 76 65 63 74 6f 72 20 77 |nterger |vector w|
|000046d0| 69 74 68 20 74 68 65 20 | 63 68 61 72 61 63 74 65 |ith the |characte|
|000046e0| 72 73 20 66 72 6f 6d 20 | 61 20 6e 75 6c 6c 0a 58 |rs from |a null.X|
|000046f0| 20 2a 20 74 65 72 6d 69 | 6e 61 74 65 64 20 73 74 | * termi|nated st|
|00004700| 72 69 6e 67 2e 20 20 54 | 68 65 20 69 6e 74 65 72 |ring. T|he inter|
|00004710| 67 65 72 20 76 65 63 74 | 6f 72 20 69 73 20 74 65 |ger vect|or is te|
|00004720| 72 6d 69 6e 61 74 65 64 | 20 62 79 20 74 68 65 0a |rminated| by the.|
|00004730| 58 20 2a 20 76 61 6c 75 | 65 20 4e 4f 4e 45 2e 0a |X * valu|e NONE..|
|00004740| 58 20 2a 2f 0a 58 73 74 | 72 32 70 76 65 63 28 63 |X */.Xst|r2pvec(c|
|00004750| 70 74 72 2c 20 69 70 74 | 72 29 0a 58 63 68 61 72 |ptr, ipt|r).Xchar|
|00004760| 09 2a 63 70 74 72 3b 0a | 58 69 6e 74 09 2a 69 70 |.*cptr;.|Xint.*ip|
|00004770| 74 72 3b 0a 58 7b 0a 58 | 09 77 68 69 6c 65 20 28 |tr;.X{.X|.while (|
|00004780| 2a 69 70 74 72 2b 2b 20 | 3d 20 28 4d 4f 44 4d 41 |*iptr++ |= (MODMA|
|00004790| 53 4b 20 26 20 2a 63 70 | 74 72 2b 2b 29 29 3b 0a |SK & *cp|tr++));.|
|000047a0| 58 09 2a 28 2d 2d 69 70 | 74 72 29 20 3d 20 4e 4f |X.*(--ip|tr) = NO|
|000047b0| 4e 45 3b 0a 58 7d 0a 58 | 0a 58 0a 58 2f 2a 20 46 |NE;.X}.X|.X.X/* F|
|000047c0| 69 6c 6c 20 69 6e 20 61 | 20 6e 75 6c 6c 20 74 65 |ill in a| null te|
|000047d0| 72 6d 69 6e 61 74 65 64 | 20 73 74 72 69 6e 67 20 |rminated| string |
|000047e0| 77 69 74 68 20 74 68 65 | 20 69 6e 74 65 67 65 72 |with the| integer|
|000047f0| 73 20 66 72 6f 6d 20 61 | 20 4e 4f 4e 45 0a 58 20 |s from a| NONE.X |
|00004800| 2a 20 74 65 72 6d 69 6e | 61 74 65 64 20 76 65 63 |* termin|ated vec|
|00004810| 74 6f 72 2e 0a 58 20 2a | 2f 0a 58 70 76 65 63 32 |tor..X *|/.Xpvec2|
|00004820| 73 74 72 28 63 70 74 72 | 2c 20 69 70 74 72 29 0a |str(cptr|, iptr).|
|00004830| 58 63 68 61 72 09 2a 63 | 70 74 72 3b 0a 58 69 6e |Xchar.*c|ptr;.Xin|
|00004840| 74 09 09 2a 69 70 74 72 | 3b 0a 58 7b 0a 58 09 77 |t..*iptr|;.X{.X.w|
|00004850| 68 69 6c 65 20 28 2a 69 | 70 74 72 20 21 3d 20 4e |hile (*i|ptr != N|
|00004860| 4f 4e 45 29 20 20 7b 0a | 58 09 09 2a 63 70 74 72 |ONE) {.|X..*cptr|
|00004870| 2b 2b 20 3d 20 28 4d 4f | 44 4d 41 53 4b 20 26 20 |++ = (MO|DMASK & |
|00004880| 2a 69 70 74 72 2b 2b 29 | 3b 0a 58 09 09 7d 0a 58 |*iptr++)|;.X..}.X|
|00004890| 09 2a 63 70 74 72 20 3d | 20 30 3b 0a 58 7d 0a 58 |.*cptr =| 0;.X}.X|
|000048a0| 0a 58 0a 58 2f 2a 20 50 | 72 69 6e 74 20 61 20 70 |.X.X/* P|rint a p|
|000048b0| 76 65 63 20 6f 6e 20 61 | 20 73 74 72 65 61 6d 2e |vec on a| stream.|
|000048c0| 0a 58 20 2a 2f 0a 58 70 | 72 69 6e 74 5f 70 76 65 |.X */.Xp|rint_pve|
|000048d0| 63 28 6f 75 74 2c 20 70 | 76 65 63 29 0a 58 46 49 |c(out, p|vec).XFI|
|000048e0| 4c 45 09 2a 6f 75 74 3b | 0a 58 69 6e 74 09 09 2a |LE.*out;|.Xint..*|
|000048f0| 70 76 65 63 3b 0a 58 7b | 0a 58 09 69 6e 74 09 09 |pvec;.X{|.X.int..|
|00004900| 69 2c 63 3b 0a 58 0a 58 | 09 69 20 3d 20 30 3b 0a |i,c;.X.X|.i = 0;.|
|00004910| 58 09 77 68 69 6c 65 20 | 28 2a 70 76 65 63 20 21 |X.while |(*pvec !|
|00004920| 3d 20 4e 4f 4e 45 29 20 | 20 7b 0a 58 09 09 63 20 |= NONE) | {.X..c |
|00004930| 3d 20 2a 70 76 65 63 2b | 2b 3b 0a 58 09 09 69 66 |= *pvec+|+;.X..if|
|00004940| 20 28 69 2b 2b 20 25 20 | 32 30 20 3d 3d 20 30 29 | (i++ % |20 == 0)|
|00004950| 20 66 70 72 69 6e 74 66 | 28 6f 75 74 2c 22 5c 6e | fprintf|(out,"\n|
|00004960| 22 29 3b 0a 58 09 09 77 | 72 69 74 65 5f 63 68 61 |");.X..w|rite_cha|
|00004970| 72 28 6f 75 74 2c 20 63 | 29 3b 0a 58 09 09 7d 0a |r(out, c|);.X..}.|
|00004980| 58 09 66 70 72 69 6e 74 | 66 28 6f 75 74 2c 22 5c |X.fprint|f(out,"\|
|00004990| 6e 22 29 3b 0a 58 7d 0a | 58 0a 58 0a 58 2f 2a 20 |n");.X}.|X.X.X/* |
|000049a0| 52 65 74 75 72 6e 73 20 | 6e 75 6d 62 65 72 20 6f |Returns |number o|
|000049b0| 66 20 77 69 72 65 73 20 | 61 64 64 65 64 20 74 6f |f wires |added to|
|000049c0| 20 70 65 72 6d 76 65 63 | 20 61 73 73 75 6d 69 6e | permvec| assumin|
|000049d0| 67 0a 58 20 2a 20 74 68 | 61 74 20 70 6c 61 69 6e |g.X * th|at plain|
|000049e0| 74 65 78 74 20 73 74 72 | 20 6f 63 63 75 72 73 20 |text str| occurs |
|000049f0| 61 74 20 70 6f 73 2e 0a | 58 20 2a 20 46 69 6c 6c |at pos..|X * Fill|
|00004a00| 73 20 69 6e 20 70 65 72 | 6d 76 65 63 2e 20 20 52 |s in per|mvec. R|
|00004a10| 65 74 75 72 6e 73 20 2d | 31 20 69 66 20 63 6f 6e |eturns -|1 if con|
|00004a20| 66 6c 69 63 74 2e 0a 58 | 20 2a 20 4e 6f 74 65 20 |flict..X| * Note |
|00004a30| 74 68 61 74 20 74 68 65 | 20 6c 61 73 74 20 65 6e |that the| last en|
|00004a40| 74 72 79 20 69 6e 20 70 | 65 72 6d 76 65 63 20 69 |try in p|ermvec i|
|00004a50| 73 20 6d 61 72 6b 65 64 | 20 62 79 20 78 20 3d 3d |s marked| by x ==|
|00004a60| 20 2d 31 2e 0a 58 20 2a | 20 54 68 65 20 70 65 72 | -1..X *| The per|
|00004a70| 6d 76 65 63 20 77 69 6c | 6c 20 6e 6f 74 20 68 61 |mvec wil|l not ha|
|00004a80| 76 65 20 64 75 70 6c 69 | 63 61 74 65 73 20 61 6e |ve dupli|cates an|
|00004a90| 64 20 77 69 6c 6c 20 6e | 6f 74 20 63 6f 6e 66 6c |d will n|ot confl|
|00004aa0| 69 63 74 0a 58 20 2a 20 | 77 69 74 68 20 74 68 65 |ict.X * |with the|
|00004ab0| 20 70 65 72 6d 20 73 70 | 65 63 69 66 69 65 64 20 | perm sp|ecified |
|00004ac0| 62 79 20 65 63 69 2d 3e | 70 65 72 6d 2e 0a 58 20 |by eci->|perm..X |
|00004ad0| 2a 2f 0a 58 69 6e 74 09 | 09 70 65 72 6d 76 65 63 |*/.Xint.|.permvec|
|00004ae0| 5f 66 72 6f 6d 5f 73 74 | 72 69 6e 67 28 65 63 69 |_from_st|ring(eci|
|00004af0| 2c 20 73 74 72 2c 20 70 | 6f 73 2c 20 70 65 72 6d |, str, p|os, perm|
|00004b00| 76 65 63 29 0a 58 65 63 | 69 6e 66 6f 09 2a 65 63 |vec).Xec|info.*ec|
|00004b10| 69 3b 0a 58 63 68 61 72 | 09 2a 73 74 72 3b 0a 58 |i;.Xchar|.*str;.X|
|00004b20| 69 6e 74 09 09 70 6f 73 | 3b 0a 58 70 65 72 6d 65 |int..pos|;.Xperme|
|00004b30| 6e 74 09 70 65 72 6d 76 | 65 63 5b 5d 3b 0a 58 7b |nt.permv|ec[];.X{|
|00004b40| 0a 58 09 69 6e 74 09 09 | 77 63 6f 75 6e 74 3b 0a |.X.int..|wcount;.|
|00004b50| 58 09 69 6e 74 09 09 69 | 2c 20 63 2c 20 74 6d 70 |X.int..i|, c, tmp|
|00004b60| 3b 0a 58 09 69 6e 74 09 | 09 78 2c 79 3b 0a 58 09 |;.X.int.|.x,y;.X.|
|00004b70| 63 68 61 72 09 2a 63 70 | 3b 0a 58 09 69 6e 74 09 |char.*cp|;.X.int.|
|00004b80| 09 63 75 72 70 6f 73 3b | 0a 58 0a 58 09 69 66 20 |.curpos;|.X.X.if |
|00004b90| 28 70 6f 73 20 3c 20 30 | 20 7c 7c 20 70 6f 73 20 |(pos < 0| || pos |
|00004ba0| 3e 3d 20 42 4c 4f 43 4b | 53 49 5a 45 29 20 20 7b |>= BLOCK|SIZE) {|
|00004bb0| 72 65 74 75 72 6e 28 45 | 52 52 4f 52 29 3b 7d 0a |return(E|RROR);}.|
|00004bc0| 58 0a 58 09 77 63 6f 75 | 6e 74 20 3d 20 30 3b 0a |X.X.wcou|nt = 0;.|
|00004bd0| 58 09 63 75 72 70 6f 73 | 20 3d 20 70 6f 73 3b 0a |X.curpos| = pos;.|
|00004be0| 58 09 63 70 20 3d 20 73 | 74 72 3b 0a 58 09 77 68 |X.cp = s|tr;.X.wh|
|00004bf0| 69 6c 65 20 28 28 63 20 | 3d 20 28 2a 63 70 20 26 |ile ((c |= (*cp &|
|00004c00| 20 4d 4f 44 4d 41 53 4b | 29 29 20 21 3d 20 30 20 | MODMASK|)) != 0 |
|00004c10| 20 26 26 20 20 28 63 75 | 72 70 6f 73 20 3c 20 42 | && (cu|rpos < B|
|00004c20| 4c 4f 43 4b 53 49 5a 45 | 29 29 20 20 7b 0a 58 09 |LOCKSIZE|)) {.X.|
|00004c30| 09 78 20 3d 20 65 63 69 | 2d 3e 73 63 69 70 68 65 |.x = eci|->sciphe|
|00004c40| 72 5b 63 75 72 70 6f 73 | 5d 3b 0a 58 09 09 79 20 |r[curpos|];.X..y |
|00004c50| 3d 20 4d 4f 44 4d 41 53 | 4b 20 26 20 28 63 20 2b |= MODMAS|K & (c +|
|00004c60| 20 63 75 72 70 6f 73 29 | 3b 0a 58 09 09 69 66 20 | curpos)|;.X..if |
|00004c70| 28 70 65 72 6d 5f 63 6f | 6e 66 6c 69 63 74 28 65 |(perm_co|nflict(e|
|00004c80| 63 69 2d 3e 70 65 72 6d | 2c 20 78 2c 20 79 29 29 |ci->perm|, x, y))|
|00004c90| 20 20 7b 0a 58 09 09 09 | 70 65 72 6d 76 65 63 5b | {.X...|permvec[|
|00004ca0| 30 5d 2e 78 20 3d 20 4e | 4f 4e 45 3b 0a 58 09 09 |0].x = N|ONE;.X..|
|00004cb0| 09 72 65 74 75 72 6e 28 | 45 52 52 4f 52 29 3b 0a |.return(|ERROR);.|
|00004cc0| 58 09 09 09 7d 0a 58 09 | 09 66 6f 72 20 28 69 20 |X...}.X.|.for (i |
|00004cd0| 3d 20 30 20 3b 20 69 20 | 3c 20 77 63 6f 75 6e 74 |= 0 ; i |< wcount|
|00004ce0| 20 3b 20 69 2b 2b 29 20 | 7b 0a 58 09 09 09 69 66 | ; i++) |{.X...if|
|00004cf0| 20 28 20 28 70 65 72 6d | 76 65 63 5b 69 5d 2e 78 | ( (perm|vec[i].x|
|00004d00| 20 3d 3d 20 78 20 20 26 | 26 20 20 70 65 72 6d 76 | == x &|& permv|
|00004d10| 65 63 5b 69 5d 2e 79 20 | 21 3d 20 79 29 0a 58 09 |ec[i].y |!= y).X.|
|00004d20| 09 09 20 20 7c 7c 20 28 | 70 65 72 6d 76 65 63 5b |.. || (|permvec[|
|00004d30| 69 5d 2e 78 20 3d 3d 20 | 79 20 20 26 26 20 20 70 |i].x == |y && p|
|00004d40| 65 72 6d 76 65 63 5b 69 | 5d 2e 79 20 21 3d 20 78 |ermvec[i|].y != x|
|00004d50| 29 0a 58 09 09 09 20 20 | 7c 7c 20 28 70 65 72 6d |).X... ||| (perm|
|00004d60| 76 65 63 5b 69 5d 2e 79 | 20 3d 3d 20 78 20 20 26 |vec[i].y| == x &|
|00004d70| 26 20 20 70 65 72 6d 76 | 65 63 5b 69 5d 2e 78 20 |& permv|ec[i].x |
|00004d80| 21 3d 20 79 29 0a 58 09 | 09 09 20 20 7c 7c 20 28 |!= y).X.|.. || (|
|00004d90| 70 65 72 6d 76 65 63 5b | 69 5d 2e 79 20 3d 3d 20 |permvec[|i].y == |
|00004da0| 79 20 20 26 26 20 20 70 | 65 72 6d 76 65 63 5b 69 |y && p|ermvec[i|
|00004db0| 5d 2e 78 20 21 3d 20 78 | 29 20 29 20 20 7b 0a 58 |].x != x|) ) {.X|
|00004dc0| 23 69 66 20 44 45 42 55 | 47 0a 58 09 09 09 09 70 |#if DEBU|G.X....p|
|00004dd0| 72 69 6e 74 66 28 22 43 | 6f 6e 66 6c 69 63 74 20 |rintf("C|onflict |
|00004de0| 77 69 74 68 69 6e 20 70 | 65 72 6d 76 65 63 2e 5c |within p|ermvec.\|
|00004df0| 6e 22 29 3b 0a 58 23 65 | 6e 64 69 66 0a 58 09 09 |n");.X#e|ndif.X..|
|00004e00| 09 09 70 65 72 6d 76 65 | 63 5b 30 5d 2e 78 20 3d |..permve|c[0].x =|
|00004e10| 20 4e 4f 4e 45 3b 0a 58 | 09 09 09 09 72 65 74 75 | NONE;.X|....retu|
|00004e20| 72 6e 28 45 52 52 4f 52 | 29 3b 0a 58 09 09 09 09 |rn(ERROR|);.X....|
|00004e30| 7d 0a 58 09 09 09 69 66 | 20 28 20 28 70 65 72 6d |}.X...if| ( (perm|
|00004e40| 76 65 63 5b 69 5d 2e 78 | 20 3d 3d 20 78 20 20 26 |vec[i].x| == x &|
|00004e50| 26 20 20 70 65 72 6d 76 | 65 63 5b 69 5d 2e 79 20 |& permv|ec[i].y |
|00004e60| 3d 3d 20 79 29 0a 58 09 | 09 09 20 20 7c 7c 20 28 |== y).X.|.. || (|
|00004e70| 70 65 72 6d 76 65 63 5b | 69 5d 2e 78 20 3d 3d 20 |permvec[|i].x == |
|00004e80| 79 20 20 26 26 20 20 70 | 65 72 6d 76 65 63 5b 69 |y && p|ermvec[i|
|00004e90| 5d 2e 79 20 3d 3d 20 78 | 29 20 29 0a 58 09 09 09 |].y == x|) ).X...|
|00004ea0| 20 20 20 20 62 72 65 61 | 6b 3b 0a 58 09 09 09 7d | brea|k;.X...}|
|00004eb0| 0a 58 09 09 70 65 72 6d | 76 65 63 5b 69 5d 2e 78 |.X..perm|vec[i].x|
|00004ec0| 20 3d 20 78 3b 0a 58 09 | 09 70 65 72 6d 76 65 63 | = x;.X.|.permvec|
|00004ed0| 5b 69 5d 2e 79 20 3d 20 | 79 3b 0a 58 09 09 69 66 |[i].y = |y;.X..if|
|00004ee0| 20 28 69 20 3e 3d 20 77 | 63 6f 75 6e 74 29 20 20 | (i >= w|count) |
|00004ef0| 77 63 6f 75 6e 74 2b 2b | 3b 0a 58 09 20 09 63 75 |wcount++|;.X. .cu|
|00004f00| 72 70 6f 73 2b 2b 3b 0a | 58 09 09 63 70 2b 2b 3b |rpos++;.|X..cp++;|
|00004f10| 0a 58 09 09 7d 0a 58 0a | 58 09 70 65 72 6d 76 65 |.X..}.X.|X.permve|
|00004f20| 63 5b 77 63 6f 75 6e 74 | 5d 2e 78 20 3d 20 4e 4f |c[wcount|].x = NO|
|00004f30| 4e 45 3b 0a 58 09 72 65 | 74 75 72 6e 28 77 63 6f |NE;.X.re|turn(wco|
|00004f40| 75 6e 74 29 3b 0a 58 7d | 0a 58 0a 58 0a 58 0a 58 |unt);.X}|.X.X.X.X|
|00004f50| 2f 2a 20 43 6f 70 79 20 | 72 6f 75 74 69 6e 65 20 |/* Copy |routine |
|00004f60| 66 6f 72 20 70 65 72 6d | 76 65 63 73 2e 0a 58 20 |for perm|vecs..X |
|00004f70| 2a 2f 0a 58 70 65 72 6d | 76 65 63 5f 63 6f 70 79 |*/.Xperm|vec_copy|
|00004f80| 28 66 72 6f 6d 2c 20 74 | 6f 2c 20 6d 61 78 6e 75 |(from, t|o, maxnu|
|00004f90| 6d 29 0a 58 70 65 72 6d | 65 6e 74 09 66 72 6f 6d |m).Xperm|ent.from|
|00004fa0| 5b 5d 3b 0a 58 70 65 72 | 6d 65 6e 74 09 74 6f 5b |[];.Xper|ment.to[|
|00004fb0| 5d 3b 0a 58 69 6e 74 09 | 09 6d 61 78 6e 75 6d 3b |];.Xint.|.maxnum;|
|00004fc0| 0a 58 7b 0a 58 09 69 6e | 74 09 09 69 3b 0a 58 0a |.X{.X.in|t..i;.X.|
|00004fd0| 58 09 66 6f 72 20 28 69 | 20 3d 20 30 20 3b 20 69 |X.for (i| = 0 ; i|
|00004fe0| 20 3c 20 6d 61 78 6e 75 | 6d 20 3b 20 69 2b 2b 29 | < maxnu|m ; i++)|
|00004ff0| 20 20 7b 0a 58 09 09 74 | 6f 5b 69 5d 20 3d 20 66 | {.X..t|o[i] = f|
|00005000| 72 6f 6d 5b 69 5d 3b 0a | 58 09 09 69 66 20 28 66 |rom[i];.|X..if (f|
|00005010| 72 6f 6d 5b 69 5d 2e 78 | 20 3d 3d 20 4e 4f 4e 45 |rom[i].x| == NONE|
|00005020| 29 20 62 72 65 61 6b 3b | 0a 58 09 09 7d 0a 58 7d |) break;|.X..}.X}|
|00005030| 0a 58 0a 58 0a 58 2f 2a | 20 43 6f 70 79 20 72 6f |.X.X.X/*| Copy ro|
|00005040| 75 74 69 6e 65 20 66 6f | 72 20 70 76 65 63 73 2e |utine fo|r pvecs.|
|00005050| 0a 58 20 2a 2f 0a 58 70 | 76 65 63 5f 63 6f 70 79 |.X */.Xp|vec_copy|
|00005060| 28 66 72 6f 6d 2c 20 74 | 6f 2c 20 6d 61 78 6e 75 |(from, t|o, maxnu|
|00005070| 6d 29 0a 58 69 6e 74 09 | 09 66 72 6f 6d 5b 5d 3b |m).Xint.|.from[];|
|00005080| 0a 58 69 6e 74 09 09 74 | 6f 5b 5d 3b 0a 58 69 6e |.Xint..t|o[];.Xin|
|00005090| 74 09 09 6d 61 78 6e 75 | 6d 3b 0a 58 7b 0a 58 09 |t..maxnu|m;.X{.X.|
|000050a0| 69 6e 74 09 09 69 3b 0a | 58 0a 58 09 66 6f 72 20 |int..i;.|X.X.for |
|000050b0| 28 69 20 3d 20 30 20 3b | 20 69 20 3c 20 6d 61 78 |(i = 0 ;| i < max|
|000050c0| 6e 75 6d 20 3b 20 69 2b | 2b 29 20 20 7b 0a 58 09 |num ; i+|+) {.X.|
|000050d0| 09 74 6f 5b 69 5d 20 3d | 20 66 72 6f 6d 5b 69 5d |.to[i] =| from[i]|
|000050e0| 3b 0a 58 09 09 69 66 20 | 28 66 72 6f 6d 5b 69 5d |;.X..if |(from[i]|
|000050f0| 20 3d 3d 20 4e 4f 4e 45 | 29 20 62 72 65 61 6b 3b | == NONE|) break;|
|00005100| 0a 58 09 09 7d 0a 58 7d | 0a 58 0a 58 0a 58 0a 58 |.X..}.X}|.X.X.X.X|
|00005110| 2f 2a 20 46 69 6c 6c 73 | 20 69 6e 20 70 76 65 63 |/* Fills| in pvec|
|00005120| 20 77 69 74 68 20 74 68 | 65 20 70 6c 61 69 6e 74 | with th|e plaint|
|00005130| 65 78 74 20 63 68 61 72 | 61 63 74 65 72 73 20 64 |ext char|acters d|
|00005140| 65 64 75 63 65 64 0a 58 | 20 2a 20 66 72 6f 6d 20 |educed.X| * from |
|00005150| 74 68 65 20 77 69 72 65 | 73 20 69 6e 20 70 65 72 |the wire|s in per|
|00005160| 6d 76 65 63 20 74 68 61 | 74 20 61 72 65 20 6e 6f |mvec tha|t are no|
|00005170| 74 20 69 6e 20 74 68 65 | 20 70 6f 73 69 74 69 6f |t in the| positio|
|00005180| 6e 73 0a 58 20 2a 20 72 | 61 6e 67 69 6e 67 20 66 |ns.X * r|anging f|
|00005190| 72 6f 6d 20 62 75 74 66 | 69 72 73 74 20 74 6f 20 |rom butf|irst to |
|000051a0| 62 75 74 6c 61 73 74 2e | 20 20 52 65 74 75 72 6e |butlast.| Return|
|000051b0| 73 20 2d 31 20 69 66 20 | 61 6e 79 0a 58 20 2a 20 |s -1 if |any.X * |
|000051c0| 6e 6f 6e 2d 61 73 63 69 | 69 20 63 68 61 72 73 20 |non-asci|i chars |
|000051d0| 61 72 65 20 64 65 64 75 | 63 65 64 2c 20 65 6c 73 |are dedu|ced, els|
|000051e0| 65 20 63 6f 75 6e 74 20 | 6f 66 20 63 68 61 72 73 |e count |of chars|
|000051f0| 2e 0a 58 20 2a 2f 0a 58 | 69 6e 74 09 09 70 65 72 |..X */.X|int..per|
|00005200| 6d 76 65 63 32 70 76 65 | 63 28 65 63 69 2c 20 70 |mvec2pve|c(eci, p|
|00005210| 65 72 6d 76 65 63 2c 20 | 70 76 65 63 2c 20 62 75 |ermvec, |pvec, bu|
|00005220| 74 66 69 72 73 74 2c 20 | 62 75 74 6c 61 73 74 29 |tfirst, |butlast)|
|00005230| 0a 58 65 63 69 6e 66 6f | 09 2a 65 63 69 3b 0a 58 |.Xecinfo|.*eci;.X|
|00005240| 70 65 72 6d 65 6e 74 09 | 70 65 72 6d 76 65 63 5b |perment.|permvec[|
|00005250| 5d 3b 0a 58 69 6e 74 09 | 09 70 76 65 63 5b 5d 3b |];.Xint.|.pvec[];|
|00005260| 0a 58 69 6e 74 09 09 62 | 75 74 66 69 72 73 74 3b |.Xint..b|utfirst;|
|00005270| 0a 58 69 6e 74 09 09 62 | 75 74 6c 61 73 74 3b 0a |.Xint..b|utlast;.|
|00005280| 58 7b 09 69 6e 74 09 09 | 69 2c 20 78 2c 20 79 3b |X{.int..|i, x, y;|
|00005290| 0a 58 09 69 6e 74 09 09 | 63 63 6f 75 6e 74 3b 0a |.X.int..|ccount;.|
|000052a0| 58 09 69 6e 74 09 09 61 | 64 64 65 64 3b 0a 58 0a |X.int..a|dded;.X.|
|000052b0| 58 09 63 63 6f 75 6e 74 | 20 3d 20 30 3b 0a 58 0a |X.ccount| = 0;.X.|
|000052c0| 58 09 66 6f 72 20 28 69 | 20 3d 20 30 20 3b 20 70 |X.for (i| = 0 ; p|
|000052d0| 65 72 6d 76 65 63 5b 69 | 5d 2e 78 20 21 3d 20 4e |ermvec[i|].x != N|
|000052e0| 4f 4e 45 20 3b 20 69 2b | 2b 29 20 20 7b 0a 58 09 |ONE ; i+|+) {.X.|
|000052f0| 09 69 66 20 28 63 63 6f | 75 6e 74 20 3e 3d 20 42 |.if (cco|unt >= B|
|00005300| 4c 4f 43 4b 53 49 5a 45 | 2d 31 29 20 62 72 65 61 |LOCKSIZE|-1) brea|
|00005310| 6b 3b 0a 58 09 09 78 20 | 3d 20 70 65 72 6d 76 65 |k;.X..x |= permve|
|00005320| 63 5b 69 5d 2e 78 3b 0a | 58 09 09 79 20 3d 20 70 |c[i].x;.|X..y = p|
|00005330| 65 72 6d 76 65 63 5b 69 | 5d 2e 79 3b 0a 58 09 09 |ermvec[i|].y;.X..|
|00005340| 61 64 64 65 64 20 3d 20 | 64 65 63 6f 64 65 5f 77 |added = |decode_w|
|00005350| 69 72 65 5f 62 75 74 28 | 65 63 69 2c 20 78 2c 20 |ire_but(|eci, x, |
|00005360| 79 2c 20 26 28 70 76 65 | 63 5b 63 63 6f 75 6e 74 |y, &(pve|c[ccount|
|00005370| 5d 29 2c 20 62 75 74 66 | 69 72 73 74 2c 20 62 75 |]), butf|irst, bu|
|00005380| 74 6c 61 73 74 29 3b 0a | 58 09 09 69 66 20 28 61 |tlast);.|X..if (a|
|00005390| 64 64 65 64 20 3c 20 30 | 29 20 20 7b 0a 58 23 69 |dded < 0|) {.X#i|
|000053a0| 66 20 44 45 42 55 47 0a | 58 09 09 09 70 72 69 6e |f DEBUG.|X...prin|
|000053b0| 74 66 28 22 70 65 72 6d | 76 65 63 20 77 69 72 65 |tf("perm|vec wire|
|000053c0| 20 64 65 63 6f 64 65 73 | 20 74 6f 20 6e 6f 6e 2d | decodes| to non-|
|000053d0| 61 73 63 69 69 2e 5c 6e | 22 29 3b 0a 58 23 65 6e |ascii.\n|");.X#en|
|000053e0| 64 69 66 0a 58 09 09 09 | 70 76 65 63 5b 30 5d 20 |dif.X...|pvec[0] |
|000053f0| 3d 20 2d 31 3b 0a 58 09 | 09 09 72 65 74 75 72 6e |= -1;.X.|..return|
|00005400| 28 45 52 52 4f 52 29 3b | 0a 58 09 09 09 7d 0a 58 |(ERROR);|.X...}.X|
|00005410| 09 09 63 63 6f 75 6e 74 | 20 2b 3d 20 61 64 64 65 |..ccount| += adde|
|00005420| 64 3b 0a 58 09 09 7d 0a | 58 09 70 76 65 63 5b 63 |d;.X..}.|X.pvec[c|
|00005430| 63 6f 75 6e 74 5d 20 3d | 20 2d 31 3b 0a 58 09 72 |count] =| -1;.X.r|
|00005440| 65 74 75 72 6e 28 63 63 | 6f 75 6e 74 29 3b 0a 58 |eturn(cc|ount);.X|
|00005450| 7d 0a 45 4e 44 5f 4f 46 | 5f 63 69 70 68 65 72 2e |}.END_OF|_cipher.|
|00005460| 63 0a 69 66 20 74 65 73 | 74 20 39 36 34 31 20 2d |c.if tes|t 9641 -|
|00005470| 6e 65 20 60 77 63 20 2d | 63 20 3c 63 69 70 68 65 |ne `wc -|c <ciphe|
|00005480| 72 2e 63 60 3b 20 74 68 | 65 6e 0a 20 20 20 20 65 |r.c`; th|en. e|
|00005490| 63 68 6f 20 73 68 61 72 | 3a 20 5c 22 63 69 70 68 |cho shar|: \"ciph|
|000054a0| 65 72 2e 63 5c 22 20 75 | 6e 70 61 63 6b 65 64 20 |er.c\" u|npacked |
|000054b0| 77 69 74 68 20 77 72 6f | 6e 67 20 73 69 7a 65 21 |with wro|ng size!|
|000054c0| 0a 66 69 0a 23 20 65 6e | 64 20 6f 66 20 6f 76 65 |.fi.# en|d of ove|
|000054d0| 72 77 72 69 74 69 6e 67 | 20 63 68 65 63 6b 0a 66 |rwriting| check.f|
|000054e0| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 65 63 6c |i.if tes|t -f ecl|
|000054f0| 61 73 73 2e 63 20 2d 61 | 20 22 24 7b 31 7d 22 20 |ass.c -a| "${1}" |
|00005500| 21 3d 20 22 2d 63 22 20 | 3b 20 74 68 65 6e 20 0a |!= "-c" |; then .|
|00005510| 20 20 65 63 68 6f 20 73 | 68 61 72 3a 20 57 69 6c | echo s|har: Wil|
|00005520| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|00005530| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 5c | existin|g file \|
|00005540| 22 65 63 6c 61 73 73 2e | 63 5c 22 0a 65 6c 73 65 |"eclass.|c\".else|
|00005550| 0a 65 63 68 6f 20 73 68 | 61 72 3a 20 45 78 74 72 |.echo sh|ar: Extr|
|00005560| 61 63 74 69 6e 67 20 5c | 22 65 63 6c 61 73 73 2e |acting \|"eclass.|
|00005570| 63 5c 22 20 5c 28 39 31 | 39 32 20 63 68 61 72 61 |c\" \(91|92 chara|
|00005580| 63 74 65 72 73 5c 29 0a | 73 65 64 20 22 73 2f 5e |cters\).|sed "s/^|
|00005590| 58 2f 2f 22 20 3e 65 63 | 6c 61 73 73 2e 63 20 3c |X//" >ec|lass.c <|
|000055a0| 3c 27 45 4e 44 5f 4f 46 | 5f 65 63 6c 61 73 73 2e |<'END_OF|_eclass.|
|000055b0| 63 27 0a 58 2f 2a 0a 58 | 20 2a 20 45 71 75 69 76 |c'.X/*.X| * Equiv|
|000055c0| 61 6c 65 6e 63 65 20 63 | 6c 61 73 73 20 69 6e 66 |alence c|lass inf|
|000055d0| 6f 72 6d 61 74 69 6f 6e | 20 61 62 6f 75 74 20 61 |ormation| about a|
|000055e0| 20 63 69 70 68 65 72 20 | 62 6c 6f 63 6b 2e 0a 58 | cipher |block..X|
|000055f0| 20 2a 0a 58 20 2a 20 42 | 6f 62 20 42 61 6c 64 77 | *.X * B|ob Baldw|
|00005600| 69 6e 2c 20 4a 61 6e 75 | 61 72 79 20 31 39 38 35 |in, Janu|ary 1985|
|00005610| 2e 0a 58 20 2a 2f 0a 58 | 0a 58 23 69 6e 63 6c 75 |..X */.X|.X#inclu|
|00005620| 64 65 09 3c 73 74 64 69 | 6f 2e 68 3e 0a 58 23 69 |de.<stdi|o.h>.X#i|
|00005630| 6e 63 6c 75 64 65 09 3c | 6d 61 74 68 2e 68 3e 0a |nclude.<|math.h>.|
|00005640| 58 23 69 6e 63 6c 75 64 | 65 09 22 77 69 6e 64 6f |X#includ|e."windo|
|00005650| 77 2e 68 22 0a 58 23 69 | 6e 63 6c 75 64 65 09 22 |w.h".X#i|nclude."|
|00005660| 74 65 72 6d 69 6e 61 6c | 2e 68 22 0a 58 23 69 6e |terminal|.h".X#in|
|00005670| 63 6c 75 64 65 09 22 6c | 61 79 6f 75 74 2e 68 22 |clude."l|ayout.h"|
|00005680| 0a 58 23 69 6e 63 6c 75 | 64 65 09 22 73 70 65 63 |.X#inclu|de."spec|
|00005690| 73 2e 68 22 0a 58 23 69 | 6e 63 6c 75 64 65 09 22 |s.h".X#i|nclude."|
|000056a0| 63 69 70 68 65 72 2e 68 | 22 0a 58 0a 58 0a 58 23 |cipher.h|".X.X.X#|
|000056b0| 64 65 66 69 6e 65 09 44 | 45 42 55 47 09 46 41 4c |define.D|EBUG.FAL|
|000056c0| 53 45 0a 58 0a 58 23 64 | 65 66 69 6e 65 09 4d 49 |SE.X.X#d|efine.MI|
|000056d0| 4e 5f 53 48 4f 57 5f 53 | 43 4f 52 45 09 28 30 2e |N_SHOW_S|CORE.(0.|
|000056e0| 37 29 0a 58 23 64 65 66 | 69 6e 65 09 45 43 42 4c |7).X#def|ine.ECBL|
|000056f0| 41 42 45 4c 31 09 22 45 | 71 75 69 76 20 63 6c 61 |ABEL1."E|quiv cla|
|00005700| 73 73 20 67 75 65 73 73 | 69 6e 67 20 61 74 20 6c |ss guess|ing at l|
|00005710| 65 76 65 6c 20 25 36 2e | 33 66 20 20 2d 2d 20 50 |evel %6.|3f -- P|
|00005720| 6c 65 61 73 65 20 57 61 | 69 74 22 0a 58 23 64 65 |lease Wa|it".X#de|
|00005730| 66 69 6e 65 09 45 43 42 | 4c 41 42 45 4c 32 09 22 |fine.ECB|LABEL2."|
|00005740| 45 71 75 69 76 20 63 6c | 61 73 73 20 67 75 65 73 |Equiv cl|ass gues|
|00005750| 73 69 6e 67 20 61 74 20 | 6c 65 76 65 6c 20 25 36 |sing at |level %6|
|00005760| 2e 33 66 20 20 2d 2d 20 | 44 6f 6e 65 22 0a 58 23 |.3f -- |Done".X#|
|00005770| 64 65 66 69 6e 65 09 45 | 43 42 48 45 4c 50 20 22 |define.E|CBHELP "|
|00005780| 46 33 20 65 6e 74 65 72 | 73 20 67 75 65 73 73 2c |F3 enter|s guess,|
|00005790| 20 5e 47 20 75 6e 64 6f | 65 73 20 69 74 2e 22 0a | ^G undo|es it.".|
|000057a0| 58 0a 58 0a 58 65 78 74 | 65 72 6e 09 63 68 61 72 |X.X.Xext|ern.char|
|000057b0| 09 6d 63 62 75 66 5b 5d | 3b 0a 58 65 78 74 65 72 |.mcbuf[]|;.Xexter|
|000057c0| 6e 09 65 63 69 6e 66 6f | 09 67 65 63 69 6e 66 6f |n.ecinfo|.gecinfo|
|000057d0| 3b 0a 58 65 78 74 65 72 | 6e 09 65 63 62 64 72 61 |;.Xexter|n.ecbdra|
|000057e0| 77 28 29 2c 20 65 63 62 | 66 69 72 73 74 28 29 2c |w(), ecb|first(),|
|000057f0| 20 65 63 62 65 6e 74 65 | 72 28 29 2c 20 65 63 62 | ecbente|r(), ecb|
|00005800| 75 6e 64 6f 28 29 3b 0a | 58 0a 58 2f 2a 20 47 6c |undo();.|X.X/* Gl|
|00005810| 6f 61 62 61 6c 20 53 74 | 61 74 65 2e 20 2a 2f 0a |oabal St|ate. */.|
|00005820| 58 66 6c 6f 61 74 09 65 | 63 5f 61 63 63 65 70 74 |Xfloat.e|c_accept|
|00005830| 5f 6c 65 76 65 6c 20 3d | 20 30 2e 30 3b 0a 58 6b |_level =| 0.0;.Xk|
|00005840| 65 79 65 72 09 65 63 62 | 6b 74 61 62 5b 5d 20 3d |eyer.ecb|ktab[] =|
|00005850| 20 7b 0a 58 09 09 7b 43 | 41 43 43 45 50 54 2c 20 | {.X..{C|ACCEPT, |
|00005860| 65 63 62 65 6e 74 65 72 | 7d 2c 0a 58 09 09 7b 43 |ecbenter|},.X..{C|
|00005870| 55 4e 44 4f 2c 20 65 63 | 62 75 6e 64 6f 7d 2c 0a |UNDO, ec|bundo},.|
|00005880| 58 09 09 7b 43 47 4f 5f | 55 50 2c 20 6a 6f 67 75 |X..{CGO_|UP, jogu|
|00005890| 70 7d 2c 0a 58 09 09 7b | 43 47 4f 5f 44 4f 57 4e |p},.X..{|CGO_DOWN|
|000058a0| 2c 20 6a 6f 67 64 6f 77 | 6e 7d 2c 0a 58 09 09 7b |, jogdow|n},.X..{|
|000058b0| 43 47 4f 5f 4c 45 46 54 | 2c 20 6a 6f 67 6c 65 66 |CGO_LEFT|, joglef|
|000058c0| 74 7d 2c 0a 58 09 09 7b | 43 47 4f 5f 52 49 47 48 |t},.X..{|CGO_RIGH|
|000058d0| 54 2c 20 6a 6f 67 72 69 | 67 68 74 7d 2c 0a 58 09 |T, jogri|ght},.X.|
|000058e0| 09 7b 30 2c 20 4e 55 4c | 4c 7d 2c 0a 58 7d 3b 0a |.{0, NUL|L},.X};.|
|000058f0| 58 0a 58 0a 58 2f 2a 20 | 52 6f 75 74 69 6e 65 20 |X.X.X/* |Routine |
|00005900| 69 6e 76 6f 6b 65 64 20 | 62 79 20 75 73 65 72 20 |invoked |by user |
|00005910| 74 6f 20 70 75 74 20 75 | 70 20 74 68 65 20 65 71 |to put u|p the eq|
|00005920| 75 69 76 61 6c 65 6e 63 | 65 20 63 6c 61 73 73 0a |uivalenc|e class.|
|00005930| 58 20 2a 20 67 75 65 73 | 73 69 6e 67 20 77 69 6e |X * gues|sing win|
|00005940| 64 6f 77 2e 0a 58 20 2a | 20 54 68 65 20 77 69 6e |dow..X *| The win|
|00005950| 64 6f 77 20 69 73 20 64 | 72 61 77 6e 20 65 6d 70 |dow is d|rawn emp|
|00005960| 74 79 2c 20 61 6e 64 20 | 74 68 65 6e 20 66 69 6c |ty, and |then fil|
|00005970| 6c 65 64 20 69 6e 20 77 | 69 74 68 20 74 68 65 20 |led in w|ith the |
|00005980| 67 75 65 73 73 2e 0a 58 | 20 2a 20 52 65 74 75 72 |guess..X| * Retur|
|00005990| 6e 20 4e 55 4c 4c 20 69 | 66 20 63 6f 6d 6d 61 6e |n NULL i|f comman|
|000059a0| 64 20 63 6f 6d 70 6c 65 | 74 65 73 20 6f 6b 2e 0a |d comple|tes ok..|
|000059b0| 58 20 2a 2f 0a 58 63 68 | 61 72 09 2a 65 63 62 67 |X */.Xch|ar.*ecbg|
|000059c0| 75 65 73 73 28 73 74 72 | 29 0a 58 63 68 61 72 09 |uess(str|).Xchar.|
|000059d0| 2a 73 74 72 3b 09 09 09 | 2f 2a 20 43 6f 6d 6d 61 |*str;...|/* Comma|
|000059e0| 6e 64 20 6c 69 6e 65 20 | 2a 2f 0a 58 7b 0a 58 09 |nd line |*/.X{.X.|
|000059f0| 65 63 69 6e 66 6f 09 2a | 65 63 62 69 3b 0a 58 09 |ecinfo.*|ecbi;.X.|
|00005a00| 69 6e 74 09 09 69 3b 0a | 58 09 67 77 69 6e 64 6f |int..i;.|X.gwindo|
|00005a10| 77 09 2a 65 63 62 3b 0a | 58 0a 58 09 65 63 62 20 |w.*ecb;.|X.X.ecb |
|00005a20| 3d 20 26 67 62 73 74 6f | 72 65 3b 0a 58 09 65 63 |= &gbsto|re;.X.ec|
|00005a30| 62 69 20 3d 20 26 67 65 | 63 69 6e 66 6f 3b 0a 58 |bi = &ge|cinfo;.X|
|00005a40| 09 65 63 5f 69 6e 69 74 | 28 6d 63 62 75 66 2c 20 |.ec_init|(mcbuf, |
|00005a50| 72 65 66 70 65 72 6d 28 | 64 62 73 67 65 74 62 6c |refperm(|dbsgetbl|
|00005a60| 6b 28 26 64 62 73 74 6f | 72 65 29 29 2c 20 65 63 |k(&dbsto|re)), ec|
|00005a70| 62 69 29 3b 0a 58 0a 58 | 09 69 66 20 28 28 69 20 |bi);.X.X|.if ((i |
|00005a80| 3d 20 73 73 63 61 6e 66 | 28 73 74 72 2c 20 22 25 |= sscanf|(str, "%|
|00005a90| 2a 5b 5e 3a 5d 3a 20 25 | 66 22 2c 20 26 65 63 5f |*[^:]: %|f", &ec_|
|00005aa0| 61 63 63 65 70 74 5f 6c | 65 76 65 6c 29 29 20 21 |accept_l|evel)) !|
|00005ab0| 3d 20 31 29 20 20 7b 0a | 58 09 09 72 65 74 75 72 |= 1) {.|X..retur|
|00005ac0| 6e 28 22 43 6f 75 6c 64 | 20 6e 6f 74 20 70 61 72 |n("Could| not par|
|00005ad0| 73 65 20 61 63 63 65 70 | 74 61 6e 63 65 20 6c 65 |se accep|tance le|
|00005ae0| 76 65 6c 2e 22 29 3b 0a | 58 09 09 7d 0a 58 0a 58 |vel.");.|X..}.X.X|
|00005af0| 09 67 62 73 73 77 69 74 | 63 68 28 65 63 62 2c 20 |.gbsswit|ch(ecb, |
|00005b00| 28 28 63 68 61 72 20 2a | 29 20 65 63 62 69 29 2c |((char *|) ecbi),|
|00005b10| 20 65 63 62 6b 74 61 62 | 2c 20 65 63 62 66 69 72 | ecbktab|, ecbfir|
|00005b20| 73 74 2c 20 77 6c 5f 6e | 6f 6f 70 2c 20 65 63 62 |st, wl_n|oop, ecb|
|00005b30| 64 72 61 77 29 3b 0a 58 | 0a 58 09 73 70 72 69 6e |draw);.X|.X.sprin|
|00005b40| 74 66 28 73 74 61 74 6d | 73 67 2c 20 45 43 42 4c |tf(statm|sg, ECBL|
|00005b50| 41 42 45 4c 31 2c 20 65 | 63 5f 61 63 63 65 70 74 |ABEL1, e|c_accept|
|00005b60| 5f 6c 65 76 65 6c 29 3b | 0a 58 09 67 62 6c 73 65 |_level);|.X.gblse|
|00005b70| 74 28 26 67 62 6c 61 62 | 65 6c 2c 20 73 74 61 74 |t(&gblab|el, stat|
|00005b80| 6d 73 67 29 3b 0a 58 0a | 58 09 65 63 62 64 72 61 |msg);.X.|X.ecbdra|
|00005b90| 77 28 65 63 62 29 3b 0a | 58 09 66 66 6c 75 73 68 |w(ecb);.|X.fflush|
|00005ba0| 28 73 74 64 6f 75 74 29 | 3b 0a 58 0a 58 09 65 63 |(stdout)|;.X.X.ec|
|00005bb0| 5f 61 75 74 6f 67 75 65 | 73 73 28 65 63 62 69 2c |_autogue|ss(ecbi,|
|00005bc0| 20 65 63 5f 61 63 63 65 | 70 74 5f 6c 65 76 65 6c | ec_acce|pt_level|
|00005bd0| 29 3b 0a 58 09 64 65 63 | 6f 64 65 28 65 63 62 69 |);.X.dec|ode(ecbi|
|00005be0| 2d 3e 63 69 70 68 65 72 | 74 65 78 74 2c 20 65 63 |->cipher|text, ec|
|00005bf0| 62 69 2d 3e 70 6c 61 69 | 6e 74 65 78 74 2c 20 65 |bi->plai|ntext, e|
|00005c00| 63 62 69 2d 3e 70 65 72 | 6d 29 3b 0a 58 0a 58 09 |cbi->per|m);.X.X.|
|00005c10| 73 70 72 69 6e 74 66 28 | 73 74 61 74 6d 73 67 2c |sprintf(|statmsg,|
|00005c20| 20 45 43 42 4c 41 42 45 | 4c 32 2c 20 65 63 5f 61 | ECBLABE|L2, ec_a|
|00005c30| 63 63 65 70 74 5f 6c 65 | 76 65 6c 29 3b 0a 58 09 |ccept_le|vel);.X.|
|00005c40| 67 62 6c 73 65 74 28 26 | 67 62 6c 61 62 65 6c 2c |gblset(&|gblabel,|
|00005c50| 20 73 74 61 74 6d 73 67 | 29 3b 0a 58 09 65 63 62 | statmsg|);.X.ecb|
|00005c60| 64 72 61 77 28 65 63 62 | 29 3b 0a 58 0a 58 09 72 |draw(ecb|);.X.X.r|
|00005c70| 65 74 75 72 6e 28 4e 55 | 4c 4c 29 3b 0a 58 7d 0a |eturn(NU|LL);.X}.|
|00005c80| 58 0a 58 0a 58 2f 2a 20 | 20 28 72 65 29 20 44 72 |X.X.X/* | (re) Dr|
|00005c90| 61 77 20 74 68 65 20 77 | 69 6e 64 6f 77 2e 0a 58 |aw the w|indow..X|
|00005ca0| 20 2a 2f 0a 58 65 63 62 | 64 72 61 77 28 65 63 62 | */.Xecb|draw(ecb|
|00005cb0| 29 0a 58 67 77 69 6e 64 | 6f 77 09 2a 65 63 62 3b |).Xgwind|ow.*ecb;|
|00005cc0| 0a 58 7b 0a 58 09 69 6e | 74 09 09 09 69 3b 0a 58 |.X{.X.in|t...i;.X|
|00005cd0| 09 69 6e 74 09 09 09 72 | 6f 77 2c 20 63 6f 6c 3b |.int...r|ow, col;|
|00005ce0| 0a 58 09 65 63 69 6e 66 | 6f 09 09 2a 65 63 62 69 |.X.ecinf|o..*ecbi|
|00005cf0| 3b 0a 58 0a 58 09 65 63 | 62 69 20 3d 20 28 28 65 |;.X.X.ec|bi = ((e|
|00005d00| 63 69 6e 66 6f 20 2a 29 | 20 65 63 62 2d 3e 77 70 |cinfo *)| ecb->wp|
|00005d10| 72 69 76 61 74 65 29 3b | 0a 58 09 72 6f 77 20 3d |rivate);|.X.row =|
|00005d20| 20 31 3b 0a 58 09 63 6f | 6c 20 3d 20 31 3b 0a 58 | 1;.X.co|l = 1;.X|
|00005d30| 0a 58 09 66 6f 72 20 28 | 69 20 3d 20 30 20 3b 20 |.X.for (|i = 0 ; |
|00005d40| 69 20 3c 20 42 4c 4f 43 | 4b 53 49 5a 45 20 3b 20 |i < BLOC|KSIZE ; |
|00005d50| 69 2b 2b 29 20 20 7b 0a | 58 09 09 69 66 20 28 69 |i++) {.|X..if (i|
|00005d60| 25 4c 49 4e 45 4c 45 4e | 20 3d 3d 20 30 29 20 7b |%LINELEN| == 0) {|
|00005d70| 0a 58 09 09 09 77 6c 5f | 73 65 74 63 75 72 28 65 |.X...wl_|setcur(e|
|00005d80| 63 62 2c 20 67 62 73 70 | 6f 73 32 72 6f 77 28 69 |cb, gbsp|os2row(i|
|00005d90| 29 2c 20 67 62 73 70 6f | 73 32 63 6f 6c 28 69 29 |), gbspo|s2col(i)|
|00005da0| 29 3b 0a 58 09 09 09 7d | 0a 58 09 09 70 6c 6e 63 |);.X...}|.X..plnc|
|00005db0| 68 61 72 73 28 31 2c 20 | 63 68 61 72 32 73 79 6d |hars(1, |char2sym|
|00005dc0| 28 65 63 62 69 2d 3e 70 | 6c 61 69 6e 74 65 78 74 |(ecbi->p|laintext|
|00005dd0| 5b 69 5d 29 29 3b 0a 58 | 09 09 7d 0a 58 0a 58 09 |[i]));.X|..}.X.X.|
|00005de0| 66 6f 72 20 28 69 20 3d | 20 67 62 73 70 6f 73 32 |for (i =| gbspos2|
|00005df0| 72 6f 77 28 42 4c 4f 43 | 4b 53 49 5a 45 29 20 3b |row(BLOC|KSIZE) ;|
|00005e00| 20 69 20 3c 3d 20 47 42 | 48 45 49 47 48 54 20 3b | i <= GB|HEIGHT ;|
|00005e10| 20 69 2b 2b 29 20 7b 0a | 58 09 09 77 6c 5f 73 65 | i++) {.|X..wl_se|
|00005e20| 74 63 75 72 28 65 63 62 | 2c 20 69 2c 20 31 29 3b |tcur(ecb|, i, 1);|
|00005e30| 0a 58 09 09 70 6c 6e 63 | 68 61 72 73 28 4c 49 4e |.X..plnc|hars(LIN|
|00005e40| 45 4c 45 4e 2c 20 27 20 | 27 29 3b 0a 58 09 09 7d |ELEN, ' |');.X..}|
|00005e50| 0a 58 0a 58 09 66 6f 72 | 20 28 69 20 3d 20 31 20 |.X.X.for| (i = 1 |
|00005e60| 3b 20 69 20 3c 3d 20 47 | 42 48 45 49 47 48 54 20 |; i <= G|BHEIGHT |
|00005e70| 3b 20 69 2b 2b 29 20 7b | 0a 58 09 09 77 6c 5f 73 |; i++) {|.X..wl_s|
|00005e80| 65 74 63 75 72 28 65 63 | 62 2c 20 69 2c 20 4c 49 |etcur(ec|b, i, LI|
|00005e90| 4e 45 4c 45 4e 2b 31 29 | 3b 0a 58 09 09 70 6c 6e |NELEN+1)|;.X..pln|
|00005ea0| 63 68 61 72 73 28 65 63 | 62 2d 3e 77 77 69 64 74 |chars(ec|b->wwidt|
|00005eb0| 68 20 2d 20 4c 49 4e 45 | 4c 45 4e 2c 20 27 20 27 |h - LINE|LEN, ' '|
|00005ec0| 29 3b 0a 58 09 09 7d 0a | 58 0a 58 09 77 6c 5f 73 |);.X..}.|X.X.wl_s|
|00005ed0| 65 74 63 75 72 28 65 63 | 62 2c 20 72 6f 77 2c 20 |etcur(ec|b, row, |
|00005ee0| 63 6f 6c 29 3b 0a 58 7d | 0a 58 0a 58 0a 58 2f 2a |col);.X}|.X.X.X/*|
|00005ef0| 20 46 69 72 73 74 20 74 | 69 6d 65 20 63 75 72 73 | First t|ime curs|
|00005f00| 6f 72 20 65 6e 74 65 72 | 73 20 77 69 6e 64 6f 77 |or enter|s window|
|00005f10| 2e 0a 58 20 2a 2f 0a 58 | 65 63 62 66 69 72 73 74 |..X */.X|ecbfirst|
|00005f20| 28 65 63 62 2c 20 72 6f | 77 2c 20 63 6f 6c 29 0a |(ecb, ro|w, col).|
|00005f30| 58 67 77 69 6e 64 6f 77 | 09 2a 65 63 62 3b 0a 58 |Xgwindow|.*ecb;.X|
|00005f40| 69 6e 74 09 09 09 72 6f | 77 2c 20 63 6f 6c 3b 0a |int...ro|w, col;.|
|00005f50| 58 7b 0a 58 09 75 73 72 | 68 65 6c 70 28 26 75 73 |X{.X.usr|help(&us|
|00005f60| 65 72 2c 20 45 43 42 48 | 45 4c 50 29 3b 0a 58 09 |er, ECBH|ELP);.X.|
|00005f70| 77 6c 5f 73 65 74 63 75 | 72 28 65 63 62 2c 20 72 |wl_setcu|r(ecb, r|
|00005f80| 6f 77 2c 20 63 6f 6c 29 | 3b 0a 58 7d 0a 58 0a 58 |ow, col)|;.X}.X.X|
|00005f90| 0a 58 2f 2a 20 45 6e 74 | 65 72 20 74 68 65 20 67 |.X/* Ent|er the g|
|00005fa0| 75 65 73 73 20 69 6e 74 | 6f 20 74 68 65 20 64 65 |uess int|o the de|
|00005fb0| 63 72 79 70 74 69 6f 6e | 20 62 6c 6f 63 6b 2e 0a |cryption| block..|
|00005fc0| 58 20 2a 2f 0a 58 65 63 | 62 65 6e 74 65 72 28 65 |X */.Xec|benter(e|
|00005fd0| 63 62 29 0a 58 67 77 69 | 6e 64 6f 77 09 2a 65 63 |cb).Xgwi|ndow.*ec|
|00005fe0| 62 3b 0a 58 7b 0a 58 09 | 65 63 69 6e 66 6f 09 09 |b;.X{.X.|ecinfo..|
|00005ff0| 2a 65 63 62 69 3b 0a 58 | 0a 58 09 65 63 62 69 20 |*ecbi;.X|.X.ecbi |
|00006000| 3d 20 28 28 65 63 69 6e | 66 6f 20 2a 29 20 65 63 |= ((ecin|fo *) ec|
|00006010| 62 2d 3e 77 70 72 69 76 | 61 74 65 29 3b 0a 58 09 |b->wpriv|ate);.X.|
|00006020| 64 62 73 6d 65 72 67 65 | 28 26 64 62 73 74 6f 72 |dbsmerge|(&dbstor|
|00006030| 65 2c 20 65 63 62 69 2d | 3e 70 65 72 6d 29 3b 0a |e, ecbi-|>perm);.|
|00006040| 58 09 77 6c 5f 72 63 75 | 72 73 6f 72 28 65 63 62 |X.wl_rcu|rsor(ecb|
|00006050| 29 3b 0a 58 7d 0a 58 0a | 58 0a 58 2f 2a 20 55 6e |);.X}.X.|X.X/* Un|
|00006060| 64 6f 20 74 68 65 20 6c | 61 73 74 20 67 75 65 73 |do the l|ast gues|
|00006070| 73 2e 0a 58 20 2a 2f 0a | 58 65 63 62 75 6e 64 6f |s..X */.|Xecbundo|
|00006080| 28 65 63 62 29 0a 58 67 | 77 69 6e 64 6f 77 09 2a |(ecb).Xg|window.*|
|00006090| 65 63 62 3b 0a 58 7b 0a | 58 09 65 63 69 6e 66 6f |ecb;.X{.|X.ecinfo|
|000060a0| 09 09 2a 65 63 62 69 3b | 0a 58 0a 58 09 65 63 62 |..*ecbi;|.X.X.ecb|
|000060b0| 69 20 3d 20 28 28 65 63 | 69 6e 66 6f 20 2a 29 20 |i = ((ec|info *) |
|000060c0| 65 63 62 2d 3e 77 70 72 | 69 76 61 74 65 29 3b 0a |ecb->wpr|ivate);.|
|000060d0| 58 09 64 62 73 75 6e 64 | 6f 28 26 64 62 73 74 6f |X.dbsund|o(&dbsto|
|000060e0| 72 65 29 3b 0a 58 09 77 | 6c 5f 72 63 75 72 73 6f |re);.X.w|l_rcurso|
|000060f0| 72 28 65 63 62 29 3b 0a | 58 7d 0a 58 0a 58 0a 58 |r(ecb);.|X}.X.X.X|
|00006100| 0a 58 0a 58 2f 2a 20 44 | 75 6d 70 20 70 6c 61 69 |.X.X/* D|ump plai|
|00006110| 6e 74 65 78 74 20 63 68 | 61 72 73 20 6f 6e 74 6f |ntext ch|ars onto|
|00006120| 20 73 74 72 65 61 6d 2e | 0a 58 20 2a 2f 0a 58 65 | stream.|.X */.Xe|
|00006130| 63 5f 64 70 6c 61 69 6e | 28 6f 75 74 2c 20 65 63 |c_dplain|(out, ec|
|00006140| 69 29 0a 58 46 49 4c 45 | 09 2a 6f 75 74 3b 0a 58 |i).XFILE|.*out;.X|
|00006150| 65 63 69 6e 66 6f 09 2a | 65 63 69 3b 0a 58 7b 0a |ecinfo.*|eci;.X{.|
|00006160| 58 09 69 6e 74 09 09 69 | 2c 63 3b 0a 58 09 69 6e |X.int..i|,c;.X.in|
|00006170| 74 09 09 2a 70 62 75 66 | 3b 0a 58 0a 58 09 70 62 |t..*pbuf|;.X.X.pb|
|00006180| 75 66 20 3d 20 26 65 63 | 69 2d 3e 70 6c 61 69 6e |uf = &ec|i->plain|
|00006190| 74 65 78 74 5b 30 5d 3b | 0a 58 09 66 6f 72 20 28 |text[0];|.X.for (|
|000061a0| 69 20 3d 20 30 20 3b 20 | 69 20 3c 20 42 4c 4f 43 |i = 0 ; |i < BLOC|
|000061b0| 4b 53 49 5a 45 20 3b 20 | 69 2b 2b 29 20 7b 0a 58 |KSIZE ; |i++) {.X|
|000061c0| 09 09 63 20 3d 20 2a 70 | 62 75 66 2b 2b 3b 0a 58 |..c = *p|buf++;.X|
|000061d0| 09 09 69 66 20 28 69 20 | 25 20 32 30 20 3d 3d 20 |..if (i |% 20 == |
|000061e0| 30 29 20 20 66 70 72 69 | 6e 74 66 28 6f 75 74 2c |0) fpri|ntf(out,|
|000061f0| 22 5c 6e 22 29 3b 0a 58 | 09 09 69 66 20 28 63 20 |"\n");.X|..if (c |
|00006200| 21 3d 20 4e 4f 4e 45 29 | 0a 58 09 09 09 77 72 69 |!= NONE)|.X...wri|
|00006210| 74 65 5f 63 68 61 72 28 | 6f 75 74 2c 20 63 29 3b |te_char(|out, c);|
|00006220| 0a 58 09 09 65 6c 73 65 | 0a 58 09 09 09 77 72 69 |.X..else|.X...wri|
|00006230| 74 65 5f 63 68 61 72 28 | 6f 75 74 2c 20 27 2e 27 |te_char(|out, '.'|
|00006240| 29 3b 0a 58 09 09 7d 0a | 58 09 66 70 72 69 6e 74 |);.X..}.|X.fprint|
|00006250| 66 28 6f 75 74 2c 22 5c | 6e 22 29 3b 0a 58 7d 0a |f(out,"\|n");.X}.|
|00006260| 58 0a 58 0a 58 2f 2a 20 | 44 75 6d 70 20 73 68 69 |X.X.X/* |Dump shi|
|00006270| 66 74 65 64 20 63 69 70 | 68 65 72 20 63 68 61 72 |fted cip|her char|
|00006280| 73 20 6f 6e 74 6f 20 73 | 74 72 65 61 6d 2e 0a 58 |s onto s|tream..X|
|00006290| 20 2a 2f 0a 58 65 63 5f | 64 73 63 69 70 68 65 72 | */.Xec_|dscipher|
|000062a0| 28 6f 75 74 2c 20 65 63 | 69 29 0a 58 46 49 4c 45 |(out, ec|i).XFILE|
|000062b0| 09 2a 6f 75 74 3b 0a 58 | 65 63 69 6e 66 6f 09 2a |.*out;.X|ecinfo.*|
|000062c0| 65 63 69 3b 0a 58 7b 0a | 58 09 69 6e 74 09 09 69 |eci;.X{.|X.int..i|
|000062d0| 2c 63 3b 0a 58 09 69 6e | 74 09 09 2a 70 62 75 66 |,c;.X.in|t..*pbuf|
|000062e0| 3b 0a 58 0a 58 09 70 62 | 75 66 20 3d 20 26 65 63 |;.X.X.pb|uf = &ec|
|000062f0| 69 2d 3e 73 63 69 70 68 | 65 72 5b 30 5d 3b 0a 58 |i->sciph|er[0];.X|
|00006300| 09 66 6f 72 20 28 69 20 | 3d 20 30 20 3b 20 69 20 |.for (i |= 0 ; i |
|00006310| 3c 20 42 4c 4f 43 4b 53 | 49 5a 45 20 3b 20 69 2b |< BLOCKS|IZE ; i+|
|00006320| 2b 29 20 7b 0a 58 09 09 | 63 20 3d 20 2a 70 62 75 |+) {.X..|c = *pbu|
|00006330| 66 2b 2b 3b 0a 58 09 09 | 69 66 20 28 69 2b 2b 20 |f++;.X..|if (i++ |
|00006340| 25 20 32 30 20 3d 3d 20 | 30 29 20 20 66 70 72 69 |% 20 == |0) fpri|
|00006350| 6e 74 66 28 6f 75 74 2c | 22 5c 6e 22 29 3b 0a 58 |ntf(out,|"\n");.X|
|00006360| 09 09 69 66 20 28 63 20 | 21 3d 20 4e 4f 4e 45 29 |..if (c |!= NONE)|
|00006370| 0a 58 09 09 09 77 72 69 | 74 65 5f 63 68 61 72 28 |.X...wri|te_char(|
|00006380| 6f 75 74 2c 20 63 29 3b | 0a 58 09 09 65 6c 73 65 |out, c);|.X..else|
|00006390| 0a 58 09 09 09 77 72 69 | 74 65 5f 63 68 61 72 28 |.X...wri|te_char(|
|000063a0| 6f 75 74 2c 20 27 2e 27 | 29 3b 0a 58 09 09 7d 0a |out, '.'|);.X..}.|
|000063b0| 58 09 66 70 72 69 6e 74 | 66 28 6f 75 74 2c 22 5c |X.fprint|f(out,"\|
|000063c0| 6e 22 29 3b 0a 58 7d 0a | 58 0a 58 0a 58 2f 2a 20 |n");.X}.|X.X.X/* |
|000063d0| 44 75 6d 70 20 74 61 62 | 6c 65 20 6f 66 20 6e 65 |Dump tab|le of ne|
|000063e0| 78 74 20 70 6f 69 6e 74 | 65 72 73 20 6f 6e 74 6f |xt point|ers onto|
|000063f0| 20 61 20 73 74 72 65 61 | 6d 2e 0a 58 20 2a 2f 0a | a strea|m..X */.|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.