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

Subversion Repositories apbtoaes128

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

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 12 redbear
                        FIPS_ENABLE =RANDOM_DATA;
89
                        DATATYPE = TYPE_00;
90
 
91
//                      type_bfm = AES_WR_ONLY;
92 4 redbear
//                      type_bfm = AES_WR_ERROR_DINR_ONLY;
93
//                      type_bfm = AES_WR_ERROR_DOUTR_ONLY;
94
 
95 12 redbear
                        type_bfm = ECB_ENCRYPTION;
96 4 redbear
//                      type_bfm = ECB_DECRYPTION;
97
//                      type_bfm = ECB_KEY_GEN;
98
//                      type_bfm = ECB_DERIVATION_DECRYPTION;
99
 
100
//                      type_bfm = ECB_ENCRYPTION_DMA;
101
//                      type_bfm = ECB_DECRYPTION_DMA;
102
//                      type_bfm = ECB_KEY_GEN_DMA;
103
//                      type_bfm = ECB_DERIVATION_DECRYPTION_DMA;
104
 
105
//                      type_bfm = ECB_ENCRYPTION_CCFIE;
106
//                      type_bfm = ECB_DECRYPTION_CCFIE;
107 9 redbear
//                      type_bfm = ECB_KEY_GEN_CCFIE;
108 4 redbear
//                      type_bfm = ECB_DERIVATION_DECRYPTION_CCFIE;
109
 
110 9 redbear
 
111 5 redbear
//                      type_bfm = CBC_ENCRYPTION;
112
//                      type_bfm = CBC_DECRYPTION;
113
//                      type_bfm = CBC_DERIVATION_DECRYPTION;
114
//                      type_bfm = CBC_KEY_GEN;
115 4 redbear
 
116 5 redbear
//                      type_bfm = CBC_ENCRYPTION_DMA;
117
//                      type_bfm = CBC_DECRYPTION_DMA;
118
//                      type_bfm = CBC_DERIVATION_DECRYPTION_DMA;
119
//                      type_bfm = CBC_KEY_GEN_DMA;
120
 
121
//                      type_bfm = CBC_ENCRYPTION_CCFIE;
122
//                      type_bfm = CBC_DECRYPTION_CCFIE;
123
//                      type_bfm = CBC_DERIVATION_DECRYPTION_CCFIE;
124
//                      type_bfm = CBC_KEY_GEN_CCFIE;
125
 
126
//                      type_bfm = CTR_ENCRYPTION;
127
//                      type_bfm = CTR_DECRYPTION;
128
//                      type_bfm = CTR_KEY_GEN;
129
//                      type_bfm = CTR_DERIVATION_DECRYPTION;
130
 
131
//                      type_bfm = CTR_ENCRYPTION_DMA;
132
//                      type_bfm = CTR_DECRYPTION_DMA;
133
//                      type_bfm = CTR_KEY_GEN_DMA;
134
//                      type_bfm = CTR_DERIVATION_DECRYPTION_DMA;
135
 
136
//                      type_bfm = CTR_ENCRYPTION_CCFIE;
137
//                      type_bfm = CTR_DECRYPTION_CCFIE;
138
//                      type_bfm = CTR_KEY_GEN_CCFIE;
139
//                      type_bfm = CTR_DERIVATION_DECRYPTION_CCFIE;
140
 
141 12 redbear
//                      type_bfm = SUFLE_TEST;
142
 
143
 
144 4 redbear
                        if(PACKETS_GENERATED == MAX_ITERATIONS)
145
                        {
146
                                v_generate.value.integer = 1;
147
                                vpi_put_value(i, &v_generate, NULL, vpiNoDelay);
148
                        }
149
        }
150
 
151
        return 0;
152
}

powered by: WebSVN 2.1.0

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