OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [fp/] [implementation/] [mmix/] [crypto.mms] - Blame information for rev 315

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 hellwig
* Cryptanalysis Problem (CLASSIFIED)
2
a GREG
3
b GREG
4
c GREG
5
t GREG
6
x GREG
7
y GREG
8
       LOC Data_Segment
9
count  GREG @           Base address for wyde counts
10
       LOC @+8*(1<<16)  Space for the wyde frequencies
11
freq   GREG @           Base address for byte counts
12
       LOC @+8*(1<<8)   Space for the byte frequencies
13
p      GREG @
14
       BYTE "abracadabraa",0,"abc" Trivial test data
15
ones   GREG #0101010101010101
16
       LOC  #100
17
2H     SRU  b,a,45      Isolate next wyde.
18
       LDO  c,count,b   Load old count.
19
       INCL c,1
20
       STO  c,count,b   Store new count.
21
       SLU  a,a,16      Delete one wyde.
22
       PBNZ a,2B        Done with octabyte? \bracetext...
23
Phase1 LDOU a,p,0       Start here: Fetch the next eight bytes.
24
       INCL p,8
25
       BDIF t,ones,a    Test if there's a zero byte.
26
       PBZ  t,2B        Do main loop, unless near the end.
27
2H     SRU  b,a,45      Isolate next wyde.
28
       LDO  c,count,b   Load old count.
29
       INCL c,1
30
       STO  c,count,b   Store new count.
31
       SRU  b,t,48
32
       SLU  a,a,16
33
       BDIF t,ones,a
34
       PBZ  b,2B        Continue unless done.
35
Phase2 SET  p,8*255     1
36
1H     SL   a,p,8       255
37
       LDA  a,count,a   255      $\.a\gets{}$address of row \.p
38
       SET  b,8*255     255
39
       LDO  c,a,0       255
40
       SET  t,p         255
41
2H     INCL t,#800      255*255
42
       LDO  x,count,t   255*255  Element of column \.p
43
       LDO  y,a,b       255*255  Element of row \.p
44
       ADD  c,c,x       255*255
45
       ADD  c,c,y       255*255
46
       SUB  b,b,8       255*255
47
       PBP  b,2B        255*255
48
       STO  c,freq,p    255
49
       SUB  p,p,8       255
50
       PBP  p,1B        255
51
       POP
52
 
53
Main   IS   Phase1
54
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.