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

Subversion Repositories apbtoaes128

[/] [apbtoaes128/] [trunk/] [pli/] [aes_bfm_generate.h] - Blame information for rev 5

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

Line No. Rev Author Line
1 4 redbear
//////////////////////////////////////////////////////////////////
2
////
3
////
4
////    AES CORE BLOCK
5
////
6
////
7
////
8
//// This file is part of the APB to AES128 project
9
////
10
//// http://www.opencores.org/cores/apbtoaes128/
11
////
12
////
13
////
14
//// Description
15
////
16
//// Implementation of APB IP core according to
17
////
18
//// aes128_spec IP core specification document.
19
////
20
////
21
////
22
//// To Do: Things are right here but always all block can suffer changes
23
////
24
////
25
////
26
////
27
////
28
//// Author(s): - Felipe Fernandes Da Costa, fefe2560@gmail.com
29
////
30
///////////////////////////////////////////////////////////////// 
31
////
32
////
33
//// Copyright (C) 2009 Authors and OPENCORES.ORG
34
////
35
////
36
////
37
//// This source file may be used and distributed without
38
////
39
//// restriction provided that this copyright statement is not
40
////
41
//// removed from the file and that any derivative work contains
42
//// the original copyright notice and the associated disclaimer.
43
////
44
////
45
//// This source file is free software; you can redistribute it
46
////
47
//// and/or modify it under the terms of the GNU Lesser General
48
////
49
//// Public License as published by the Free Software Foundation;
50
//// either version 2.1 of the License, or (at your option) any
51
////
52
//// later version.
53
////
54
////
55
////
56
//// This source is distributed in the hope that it will be
57
////
58
//// useful, but WITHOUT ANY WARRANTY; without even the implied
59
////
60
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
61
////
62
//// PURPOSE. See the GNU Lesser General Public License for more
63
//// details.
64
////
65
////
66
////
67
//// You should have received a copy of the GNU Lesser General
68
////
69
//// Public License along with this source; if not, download it
70
////
71
//// from http://www.opencores.org/lgpl.shtml
72
////
73
////
74
///////////////////////////////////////////////////////////////////
75 5 redbear
 
76 4 redbear
static int aes_bfm_generate_calltf(char*user_data)
77
{
78
 
79
        vpiHandle PRESETn = vpi_handle_by_name("AES_GLADIC_tb.PRESETn", NULL);
80
        vpiHandle i = vpi_handle_by_name("AES_GLADIC_tb.i", NULL);
81
 
82
        v_generate.format=vpiIntVal;
83
        vpi_get_value(PRESETn, &v_generate);
84
 
85
        if(v_generate.value.integer == 1)
86
        {
87
 
88
                        FIPS_ENABLE = FIPS;
89 5 redbear
                        type_bfm = AES_WR_ONLY;
90 4 redbear
//                      type_bfm = AES_WR_ERROR_DINR_ONLY;
91
//                      type_bfm = AES_WR_ERROR_DOUTR_ONLY;
92
 
93
//                      type_bfm = ECB_ENCRYPTION;
94
//                      type_bfm = ECB_DECRYPTION;
95
//                      type_bfm = ECB_KEY_GEN;
96
//                      type_bfm = ECB_DERIVATION_DECRYPTION;
97
 
98
//                      type_bfm = ECB_ENCRYPTION_DMA;
99
//                      type_bfm = ECB_DECRYPTION_DMA;
100
//                      type_bfm = ECB_KEY_GEN_DMA;
101
//                      type_bfm = ECB_DERIVATION_DECRYPTION_DMA;
102
 
103
//                      type_bfm = ECB_ENCRYPTION_CCFIE;
104
//                      type_bfm = ECB_DECRYPTION_CCFIE;
105
//                      type_bfm = ECB_DERIVATION_DECRYPTION_CCFIE;
106 5 redbear
//                      type_bfm = ECB_KEY_GEN_CCFIE;
107 4 redbear
 
108 5 redbear
//                      type_bfm = CBC_ENCRYPTION;
109
//                      type_bfm = CBC_DECRYPTION;
110
//                      type_bfm = CBC_DERIVATION_DECRYPTION;
111
//                      type_bfm = CBC_KEY_GEN;
112 4 redbear
 
113 5 redbear
//                      type_bfm = CBC_ENCRYPTION_DMA;
114
//                      type_bfm = CBC_DECRYPTION_DMA;
115
//                      type_bfm = CBC_DERIVATION_DECRYPTION_DMA;
116
//                      type_bfm = CBC_KEY_GEN_DMA;
117
 
118
//                      type_bfm = CBC_ENCRYPTION_CCFIE;
119
//                      type_bfm = CBC_DECRYPTION_CCFIE;
120
//                      type_bfm = CBC_DERIVATION_DECRYPTION_CCFIE;
121
//                      type_bfm = CBC_KEY_GEN_CCFIE;
122
 
123
//                      type_bfm = CTR_ENCRYPTION;
124
//                      type_bfm = CTR_DECRYPTION;
125
//                      type_bfm = CTR_KEY_GEN;
126
//                      type_bfm = CTR_DERIVATION_DECRYPTION;
127
 
128
 
129
//                      type_bfm = CTR_ENCRYPTION_DMA;
130
//                      type_bfm = CTR_DECRYPTION_DMA;
131
//                      type_bfm = CTR_KEY_GEN_DMA;
132
//                      type_bfm = CTR_DERIVATION_DECRYPTION_DMA;
133
 
134
 
135
//                      type_bfm = CTR_ENCRYPTION_CCFIE;
136
//                      type_bfm = CTR_DECRYPTION_CCFIE;
137
//                      type_bfm = CTR_KEY_GEN_CCFIE;
138
//                      type_bfm = CTR_DERIVATION_DECRYPTION_CCFIE;
139
 
140 4 redbear
                        if(PACKETS_GENERATED == MAX_ITERATIONS)
141
                        {
142
                                v_generate.value.integer = 1;
143
                                vpi_put_value(i, &v_generate, NULL, vpiNoDelay);
144
                        }
145
        }
146
 
147
        return 0;
148
}

powered by: WebSVN 2.1.0

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