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

Subversion Repositories csa

[/] [csa/] [trunk/] [rtl/] [group_decrypt.v] - Blame information for rev 42

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

Line No. Rev Author Line
1 42 simon111
`include "../bench/timescale.v"
2
// this moduel do a decrypt group
3
 
4
module group_decrypt(
5
                          input                    clk
6
                        , input                    rst
7
                        , input                    en
8
                        , input                    dec
9
                        , input                    init
10
                        , input         [ 8*8-1:0] ck
11
                        , input         [56*8-1:0] kk
12
                        , input         [ 8*8-1:0] group
13
                        , input         [   4-1:0] bytes
14
 
15
                        , output  reg              valid
16
                        , output  reg   [ 8*8-1:0] ogroup
17
                        , output  reg   [   4-1:0] obytes
18
                );
19
 
20
        reg init_d;
21
        wire [8*8-1:0] sc_cb;
22
        wire [8*8-1:0] ib;
23
        reg  [8*8-1:0] sc_cb_d;
24
        reg  [8*8-1:0] bco_d;
25
        wire  [8*8-1:0] bco;
26
 
27
        always @(posedge clk)
28
                begin
29
                if(en)
30
                begin
31
                        sc_cb_d<=sc_cb;
32
                        bco_d<=bco;
33
                end
34
                end
35
 
36
 
37
stream_cypher stream_cypher(
38
                    .clk   (clk)
39
                  , .rst   (rst)
40
                  , .en    (en)
41
                  , .init  (init)
42
                  , .ck    (ck)
43
                  , .sb    (group)
44
                  , .cb    (sc_cb)
45
                  );
46
 
47
assign ib=init?sc_cb_d:group^sc_cb;
48
block_decypher block_decypher(
49
                          .kk (kk)
50
                        , .ib (ib)
51
                        , .bd (bco)
52
                        );
53
 
54
 
55
endmodule

powered by: WebSVN 2.1.0

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