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

Subversion Repositories csa

[/] [csa/] [tags/] [arelease/] [rtl/] [key_computer.v] - Blame information for rev 40

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

Line No. Rev Author Line
1 2 Simon111
 
2
 
3
// this module is used to computer a key
4
// author: Simon panti
5
//          mengxipeng@gmail.com
6
// refer:
7
//                      cas.c in vlc opensource project
8
 
9 4 Simon111
// this module implement the function csa_ComputeKey 
10
// and cw accord to ck
11
//     key accord to kk;
12
 
13
// 
14
 
15 2 Simon111
module key_computer(cw,key);
16 4 Simon111
                input   [63:0]   cw;             // input cw,    has 64bits
17
                output  [447:0]  key;    // output key,  has 7*64bits
18 2 Simon111
 
19
                wire    [63:0]   key1;
20
                wire    [63:0]   key2;
21
                wire    [63:0]   key3;
22
                wire    [63:0]   key4;
23
                wire    [63:0]   key5;
24
                wire    [63:0]   key6;
25
 
26
 
27 4 Simon111
                key_perm kp0 (   cw, key6 );
28
                key_perm kp1 ( key6, key5 );
29
                key_perm kp2 ( key5, key4 );
30
                key_perm kp3 ( key4, key3 );
31
                key_perm kp4 ( key3, key2 );
32
                key_perm kp5 ( key2, key1 );
33
 
34
                assign key[64*1-1:64*0]=key1 ^ 64'h0000000000000000;
35
                assign key[64*2-1:64*1]=key2 ^ 64'h0101010101010101;
36
                assign key[64*3-1:64*2]=key3 ^ 64'h0202020202020202;
37
                assign key[64*4-1:64*3]=key4 ^ 64'h0303030303030303;
38
                assign key[64*5-1:64*4]=key5 ^ 64'h0404040404040404;
39
                assign key[64*6-1:64*5]=key6 ^ 64'h0505050505050505;
40 2 Simon111
                assign key[64*7-1:64*6]=cw   ^ 64'h0606060606060606;
41
 
42
endmodule

powered by: WebSVN 2.1.0

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