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

Subversion Repositories aes_decrypt_fpga

[/] [aes_decrypt_fpga/] [trunk/] [rtl/] [verilog/] [aes_decrypt128.sv] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 schengopen
////////////////////////////////////////////////////////////////// ////
2
////                                                                                                                            ////
3
//// AES Decryption Core for FPGA                                                                       ////
4
////                                                                                                                            ////
5
//// This file is part of the AES Decryption Core for FPGA project      ////
6
//// http://www.opencores.org/cores/xxx/                                                        ////
7
////                                                                                                                            ////
8
//// Description                                                                                                        ////
9
//// Implementation of  AES Decryption Core for FPGA according to       ////
10
//// core specification document.                                                                       ////
11
////                                                                                                                            ////
12
//// To Do:                                                                                                             ////
13
//// -                                                                                                                          ////
14
////                                                                                                                            ////
15
//// Author(s):                                                                                                         ////
16
//// - scheng, schengopencores@opencores.org                                            ////
17
////                                                                                                                            ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                                                                                            ////
20
//// Copyright (C) 2009 Authors and OPENCORES.ORG                                       ////
21
////                                                                                                                            ////
22
//// This source file may be used and distributed without                       ////
23
//// restriction provided that this copyright statement is not          ////
24
//// removed from the file and that any derivative work contains        ////
25
//// the original copyright notice and the associated disclaimer.       ////
26
////                                                                                                                            ////
27
//// This source file is free software; you can redistribute it         ////
28
//// and/or modify it under the terms of the GNU Lesser General         ////
29
//// Public License as published by the Free Software Foundation;       ////
30
//// either version 2.1 of the License, or (at your option) any         ////
31
//// later version.                                                                                             ////
32
////                                                                                                                            ////
33
//// This source is distributed in the hope that it will be             ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied         ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR            ////
36
//// PURPOSE. See the GNU Lesser General Public License for more        ////
37
//// details.                                                                                                           ////
38
////                                                                                                                            ////
39
//// You should have received a copy of the GNU Lesser General          ////
40
//// Public License along with this source; if not, download it         ////
41
//// from http://www.opencores.org/lgpl.shtml                                           ////
42
////                                                                                                                            //// ///
43
///////////////////////////////////////////////////////////////////
44
////                                                                                                                            ////
45
//// Wrapper for 128-bit AES decryption                                                         ////
46
////                                                                                                                            ////
47
////////////////////////////////////////////////////////////////////////
48
module aes_decrypt128(
49
        input   [0:127] kt,
50
        input   kt_vld,         // Active high input informing key expander that a valid new key is present at kt.
51
        output  kt_rdy,         // Active high output indicates decryptor ready to accept new key.
52
 
53
        input   [0:127] ct,     // Ciphertext input
54
        input   ct_vld,         // Active high input indicates a valid ciphertext present on ct.
55
        output  ct_rdy,         // Active high output indicates decryptor ready to accept new ct.
56
 
57
        output  [0:127] pt,     // Plaintext output
58
        output  pt_vld,         // Active high output indicates valid plaintext available on pt.
59
 
60
        input   clk,
61
        input   rst
62
        );
63
 
64
        // Decryptor side
65
        wire    [0:127] rkey_decrypt;
66
        wire    rkey_vld_decrypt;
67
        wire    next_rkey_decrypt;
68
 
69
        // Key Expander side
70
        wire    [0:127] rkey_keyexp;
71
        wire    rkey_vld_keyexp;
72
 
73
        (* KEEP_HIRARACHY = "yes" *) KschBuffer KschBuffer_u(.rkey_in(rkey_keyexp),
74
                                                        .rkey_vld_in(rkey_vld_keyexp),
75
                                                        .rkey_out(rkey_decrypt),
76
                                                        .rkey_vld_out(rkey_vld_decrypt),
77
                                                        .next_rkey(next_rkey_decrypt),
78
                                                        .klen_sel(2'b00),
79
                                                        .clk(clk),
80
                                                        .rst(rst)
81
                                                        );
82
 
83
        (* KEEP_HIRARACHY = "yes" *) KeyExpand128 KeyExpand128_u(
84
                                                        .kt(kt),
85
                                                        .kt_vld(kt_vld),
86
                                                        .kt_rdy(kt_rdy),
87
                                                        .rkey(rkey_keyexp),
88
                                                        .rkey_vld(rkey_vld_keyexp),
89
                                                        .rkey_last(),
90
                                                        .clk(clk),
91
                                                        .rst(rst)
92
                                                        );
93
 
94
        (* KEEP_HIRARACHY = "yes" *) decrypt decrypt_u( .ct(ct),
95
                                        .ct_vld(ct_vld),
96
                                        .ct_rdy(ct_rdy),
97
                                        .rkey(rkey_decrypt),
98
                                        .rkey_vld(rkey_vld_decrypt),
99
                                        .next_rkey(next_rkey_decrypt),
100
                                        .pt(pt),
101
                                        .pt_vld(pt_vld),
102
                                        .klen_sel(2'b00),
103
                                        .clk(clk),
104
                                        .rst(rst)
105
                                        );
106
endmodule

powered by: WebSVN 2.1.0

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