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

Subversion Repositories csa

[/] [csa/] [trunk/] [rtl/] [key_schedule.v] - Blame information for rev 13

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

Line No. Rev Author Line
1 13 simon111
// this key_schedule module
2
module key_schedule(i_ck,o_kk);
3
        input  [8*8-1:0]  i_ck;
4
        output [56*8-1:0] o_kk;
5
 
6
        wire   [64*8-1:0] kb;
7
 
8
        assign kb[(8*8)*8-1:(7*8)*8] = i_ck;
9
 
10
        key_perm k1( .i_key(kb[(8*8)*8-1:(7*8)*8]) ,.o_key(kb[(7*8)*8-1:(6*8)*8]));
11
        key_perm k2( .i_key(kb[(7*8)*8-1:(6*8)*8]) ,.o_key(kb[(6*8)*8-1:(5*8)*8]));
12
        key_perm k3( .i_key(kb[(6*8)*8-1:(5*8)*8]) ,.o_key(kb[(5*8)*8-1:(4*8)*8]));
13
        key_perm k4( .i_key(kb[(5*8)*8-1:(4*8)*8]) ,.o_key(kb[(4*8)*8-1:(3*8)*8]));
14
        key_perm k5( .i_key(kb[(4*8)*8-1:(3*8)*8]) ,.o_key(kb[(3*8)*8-1:(2*8)*8]));
15
        key_perm k6( .i_key(kb[(3*8)*8-1:(2*8)*8]) ,.o_key(kb[(2*8)*8-1:(1*8)*8]));
16
        key_perm k7( .i_key(kb[(2*8)*8-1:(1*8)*8]) ,.o_key(kb[(1*8)*8-1:(0*8)*8]));
17
 
18
        assign o_kk [(1*8)*8-1:(0*8)*8] = kb[(1*8)*8-1:(0*8)*8] ^ 64'h0000000000000000;
19
        assign o_kk [(2*8)*8-1:(1*8)*8] = kb[(2*8)*8-1:(1*8)*8] ^ 64'h0101010101010101;
20
        assign o_kk [(3*8)*8-1:(2*8)*8] = kb[(3*8)*8-1:(2*8)*8] ^ 64'h0202020202020202;
21
        assign o_kk [(4*8)*8-1:(3*8)*8] = kb[(4*8)*8-1:(3*8)*8] ^ 64'h0303030303030303;
22
        assign o_kk [(5*8)*8-1:(4*8)*8] = kb[(5*8)*8-1:(4*8)*8] ^ 64'h0404040404040404;
23
        assign o_kk [(6*8)*8-1:(5*8)*8] = kb[(6*8)*8-1:(5*8)*8] ^ 64'h0505050505050505;
24
        assign o_kk [(7*8)*8-1:(6*8)*8] = kb[(7*8)*8-1:(6*8)*8] ^ 64'h0606060606060606;
25
 
26
endmodule

powered by: WebSVN 2.1.0

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