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

Subversion Repositories csa

[/] [csa/] [trunk/] [rtl/] [group_decrypt.v] - Diff between revs 42 and 43

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 42 Rev 43
Line 10... Line 10...
                        , input         [ 8*8-1:0] ck
                        , input         [ 8*8-1:0] ck
                        , input         [56*8-1:0] kk
                        , input         [56*8-1:0] kk
                        , input         [ 8*8-1:0] group
                        , input         [ 8*8-1:0] group
                        , input         [   4-1:0] bytes
                        , input         [   4-1:0] bytes
 
 
                        , output  reg              valid
                        , output                   valid
                        , output  reg   [ 8*8-1:0] ogroup
                        , output        [ 8*8-1:0] ogroup
                        , output  reg   [   4-1:0] obytes
                        , output        [   4-1:0] obytes
                );
                );
 
 
        reg init_d;
        reg init_d;
        wire [8*8-1:0] sc_cb;
        wire [8*8-1:0] stream;
 
        reg  [8*8-1:0] stream_d;
        wire [8*8-1:0] ib;
        wire [8*8-1:0] ib;
        reg  [8*8-1:0] sc_cb_d;
 
        reg  [8*8-1:0] bco_d;
        reg  [8*8-1:0] bco_d;
        wire  [8*8-1:0] bco;
        wire  [8*8-1:0] bco;
 
        reg en_d;
 
 
 
 
        always @(posedge clk)
        always @(posedge clk)
                begin
                begin
 
                en_d<=en;
 
                init_d<=init;
                if(en)
                if(en)
                begin
                begin
                        sc_cb_d<=sc_cb;
                        stream_d<=stream;
                        bco_d<=bco;
 
                end
                end
 
                if(en_d)
 
                        bco_d<=bco;
 
 
                end
                end
 
 
 
assign ib=(init_d)?group:group^stream;
 
 
 
 
stream_cypher stream_cypher(
stream_cypher stream_cypher(
                    .clk   (clk)
                    .clk   (clk)
                  , .rst   (rst)
                  , .rst   (rst)
                  , .en    (en)
                  , .en    (en)
                  , .init  (init)
                  , .init  (init)
                  , .ck    (ck)
                  , .ck    (ck)
                  , .sb    (group)
                  , .sb    (group)
                  , .cb    (sc_cb)
                  , .cb    (stream)
                  );
                  );
 
 
assign ib=init?sc_cb_d:group^sc_cb;
 
block_decypher block_decypher(
block_decypher block_decypher(
                          .kk (kk)
                          .kk (kk)
                        , .ib (ib)
                        , .ib (ib)
                        , .bd (bco)
                        , .bd (bco)
                        );
                        );
 
 
 
assign ogroup=group^bco_d^stream;
 
 
 
assign valid=en_d & ~init_d;
 
assign obytes=4'h8;
 
 
 
 
endmodule
endmodule
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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