URL
https://opencores.org/ocsvn/csa/csa/trunk
Subversion Repositories csa
[/] [csa/] [trunk/] [rtl/] [group_decrypt.v] - Rev 43
Go to most recent revision | Compare with Previous | Blame | View Log
`include "../bench/timescale.v" // this moduel do a decrypt group module group_decrypt( input clk , input rst , input en , input dec , input init , input [ 8*8-1:0] ck , input [56*8-1:0] kk , input [ 8*8-1:0] group , input [ 4-1:0] bytes , output valid , output [ 8*8-1:0] ogroup , output [ 4-1:0] obytes ); reg init_d; wire [8*8-1:0] stream; reg [8*8-1:0] stream_d; wire [8*8-1:0] ib; reg [8*8-1:0] bco_d; wire [8*8-1:0] bco; reg en_d; always @(posedge clk) begin en_d<=en; init_d<=init; if(en) begin stream_d<=stream; end if(en_d) bco_d<=bco; end assign ib=(init_d)?group:group^stream; stream_cypher stream_cypher( .clk (clk) , .rst (rst) , .en (en) , .init (init) , .ck (ck) , .sb (group) , .cb (stream) ); block_decypher block_decypher( .kk (kk) , .ib (ib) , .bd (bco) ); assign ogroup=group^bco_d^stream; assign valid=en_d & ~init_d; assign obytes=4'h8; endmodule
Go to most recent revision | Compare with Previous | Blame | View Log