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

Subversion Repositories csa

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 1 to Rev 2
    Reverse comparison

Rev 1 → Rev 2

/branches/avendor/rtl/key_perm.v
0,0 → 1,31
 
 
// this module do a key 64bits perm
// author: Simon panti
// mengxipeng@gmail.com
// refer:
// cas.c in vlc opensource project
 
module key_perm(i_key,o_key);
input [63:0] i_key;
output [63:0] o_key;
 
assign o_key={
i_key[6'h1B], i_key[6'h20], i_key[6'h09], i_key[6'h37],
i_key[6'h29], i_key[6'h0D], i_key[6'h3E], i_key[6'h08],
i_key[6'h02], i_key[6'h0C], i_key[6'h27], i_key[6'h25],
i_key[6'h12], i_key[6'h0E], i_key[6'h38], i_key[6'h35],
i_key[6'h18], i_key[6'h03], i_key[6'h34], i_key[6'h30],
i_key[6'h2F], i_key[6'h3D], i_key[6'h2A], i_key[6'h22],
i_key[6'h0A], i_key[6'h1F], i_key[6'h26], i_key[6'h06],
i_key[6'h15], i_key[6'h3A], i_key[6'h14], i_key[6'h1A],
i_key[6'h2C], i_key[6'h19], i_key[6'h11], i_key[6'h0F],
i_key[6'h01], i_key[6'h21], i_key[6'h2E], i_key[6'h3F],
i_key[6'h28], i_key[6'h07], i_key[6'h0B], i_key[6'h16],
i_key[6'h00], i_key[6'h23], i_key[6'h2B], i_key[6'h17],
i_key[6'h05], i_key[6'h31], i_key[6'h33], i_key[6'h24],
i_key[6'h1D], i_key[6'h1C], i_key[6'h3C], i_key[6'h39],
i_key[6'h10], i_key[6'h13], i_key[6'h3B], i_key[6'h1E],
i_key[6'h36], i_key[6'h32], i_key[6'h04], i_key[6'h2D]
};
endmodule
/branches/avendor/rtl/key_computer.v
0,0 → 1,37
 
 
// this module is used to computer a key
// author: Simon panti
// mengxipeng@gmail.com
// refer:
// cas.c in vlc opensource project
 
module key_computer(cw,key);
input [63:0] cw;
output [447:0] key;
wire [63:0] key1;
wire [63:0] key2;
wire [63:0] key3;
wire [63:0] key4;
wire [63:0] key5;
wire [63:0] key6;
wire [63:0] key7;
key_perm kp0 ( cw, key7 );
key_perm kp1 ( key7, key6 );
key_perm kp2 ( key6, key5 );
key_perm kp3 ( key5, key4 );
key_perm kp4 ( key4, key3 );
key_perm kp5 ( key3, key2 );
key_perm kp6 ( key2, key1 );
assign key[64*1-1:64*0]=key2 ^ 64'h0000000000000000;
assign key[64*2-1:64*1]=key3 ^ 64'h0101010101010101;
assign key[64*3-1:64*2]=key4 ^ 64'h0202020202020202;
assign key[64*4-1:64*3]=key5 ^ 64'h0303030303030303;
assign key[64*5-1:64*4]=key6 ^ 64'h0404040404040404;
assign key[64*6-1:64*5]=key7 ^ 64'h0505050505050505;
assign key[64*7-1:64*6]=cw ^ 64'h0606060606060606;
endmodule

powered by: WebSVN 2.1.0

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