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

Subversion Repositories apbtoaes128

[/] [apbtoaes128/] [trunk/] [pli/] [aes_monitor.h] - Blame information for rev 10

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
static int mon_calltf(char*user_data)
76
{
77
 
78
        vpiHandle PRESETn = vpi_handle_by_name("AES_GLADIC_tb.PRESETn", NULL);
79
        vpiHandle PWDATA = vpi_handle_by_name("AES_GLADIC_tb.PWDATA", NULL);
80
        vpiHandle PENABLE = vpi_handle_by_name("AES_GLADIC_tb.PENABLE", NULL);
81 9 redbear
        vpiHandle PSEL = vpi_handle_by_name("AES_GLADIC_tb.PSEL", NULL);
82 4 redbear
        vpiHandle PWRITE = vpi_handle_by_name("AES_GLADIC_tb.PWRITE", NULL);
83
        vpiHandle PADDR = vpi_handle_by_name("AES_GLADIC_tb.PADDR", NULL);
84
        vpiHandle PRDATA = vpi_handle_by_name("AES_GLADIC_tb.PRDATA", NULL);
85
        vpiHandle PREADY = vpi_handle_by_name("AES_GLADIC_tb.PREADY", NULL);
86
        vpiHandle PSLVERR = vpi_handle_by_name("AES_GLADIC_tb.PSLVERR", NULL);
87
        vpiHandle int_ccf = vpi_handle_by_name("AES_GLADIC_tb.int_ccf", NULL);
88
        vpiHandle int_err = vpi_handle_by_name("AES_GLADIC_tb.int_err", NULL);
89
        vpiHandle dma_req_wr = vpi_handle_by_name("AES_GLADIC_tb.dma_req_wr", NULL);
90
        vpiHandle dma_req_rd = vpi_handle_by_name("AES_GLADIC_tb.dma_req_rd", NULL);
91
 
92 9 redbear
        std::random_device rd;
93
        std::uniform_int_distribution<long int> data_in(0,4294967295);
94
 
95
 
96
 
97
        v_monitor.format=vpiIntVal;
98
        v_monitor_catch.format=vpiIntVal;
99
 
100
 
101
        vpi_get_value(PRESETn, &v_monitor);
102
 
103
        t_monitor.type = vpiScaledRealTime;
104
        t_monitor.real = 10;
105
 
106
        if(v_monitor.value.integer == 1)
107 4 redbear
        {
108 9 redbear
                vpi_get_value(PENABLE, &v_monitor);
109 4 redbear
 
110 9 redbear
                if(v_monitor.value.integer == 1)
111
                {
112 4 redbear
 
113 9 redbear
                                vpi_get_value(PWRITE, &v_monitor);
114
 
115
 
116
                                if(v_monitor.value.integer == 1)
117
                                {
118
                                        vpi_get_value(PADDR, &v_monitor);
119
 
120
 
121
                                        if(v_monitor.value.integer == ADDR_AES_KEYR3)
122
                                        {
123
                                                vpi_get_value(PWDATA, &v_monitor_catch);
124
                                                //printf("%X\n",v_monitor_catch.value.integer);
125
                                                A=v_monitor_catch.value.integer;
126
 
127
                                                INPUT_KEYR[0]=A>>24;
128
                                                INPUT_KEYR[1]=A>>16;
129
                                                INPUT_KEYR[2]=A>>8;
130
                                                INPUT_KEYR[3]=A;
131
                                        }
132
 
133
                                        if(v_monitor.value.integer == ADDR_AES_KEYR2)
134
                                        {
135
                                                vpi_get_value(PWDATA, &v_monitor_catch);
136
                                                //printf("%X\n",v_monitor_catch.value.integer);
137
                                                B=v_monitor_catch.value.integer;
138
 
139
                                                INPUT_KEYR[4]=B>>24;
140
                                                INPUT_KEYR[5]=B>>16;
141
                                                INPUT_KEYR[6]=B>>8;
142
                                                INPUT_KEYR[7]=B;
143
                                        }
144
 
145
                                        if(v_monitor.value.integer == ADDR_AES_KEYR1)
146
                                        {
147
                                                vpi_get_value(PWDATA, &v_monitor_catch);
148
                                                //printf("%X\n",v_monitor_catch.value.integer);
149
                                                C=v_monitor_catch.value.integer;
150
 
151
                                                INPUT_KEYR[8]=C>>24;
152
                                                INPUT_KEYR[9]=C>>16;
153
                                                INPUT_KEYR[10]=C>>8;
154
                                                INPUT_KEYR[11]=C;
155
                                        }
156
 
157
                                        if(v_monitor.value.integer == ADDR_AES_KEYR0)
158
                                        {
159
                                                vpi_get_value(PWDATA, &v_monitor_catch);
160
                                                //printf("%X\n",v_monitor_catch.value.integer);
161
                                                D=v_monitor_catch.value.integer;
162
 
163
                                                INPUT_KEYR[12]=D>>24;
164
                                                INPUT_KEYR[13]=D>>16;
165
                                                INPUT_KEYR[14]=D>>8;
166
                                                INPUT_KEYR[15]=D;
167
 
168
                                                //printf("%x%x%x%x\n",INPUT_KEYR[0],INPUT_KEYR[1],INPUT_KEYR[2],INPUT_KEYR[3]);
169
 
170
                                                //printf("%x%x%x%x\n",KEYR[0],KEYR[1],KEYR[2],KEYR[3]);                                 
171
                                        }
172
 
173
 
174
                                        if(v_monitor.value.integer == ADDR_AES_IVR3)
175
                                        {
176
                                                vpi_get_value(PWDATA, &v_monitor_catch);
177
                                                //printf("%X\n",v_monitor_catch.value.integer);
178
                                                E=v_monitor_catch.value.integer;
179
 
180
                                                INPUT_IVR[0]=E>>24;
181
                                                INPUT_IVR[1]=E>>16;
182
                                                INPUT_IVR[2]=E>>8;
183
                                                INPUT_IVR[3]=E;
184
                                        }
185
 
186
                                        if(v_monitor.value.integer == ADDR_AES_IVR2)
187
                                        {
188
                                                vpi_get_value(PWDATA, &v_monitor_catch);
189
                                                //printf("%X\n",v_monitor_catch.value.integer);
190
                                                F=v_monitor_catch.value.integer;
191
 
192
                                                INPUT_IVR[4]=F>>24;
193
                                                INPUT_IVR[5]=F>>16;
194
                                                INPUT_IVR[6]=F>>8;
195
                                                INPUT_IVR[7]=F;
196
                                        }
197
 
198
                                        if(v_monitor.value.integer == ADDR_AES_IVR1)
199
                                        {
200
                                                vpi_get_value(PWDATA, &v_monitor_catch);
201
                                                //printf("%X\n",v_monitor_catch.value.integer);
202
                                                G=v_monitor_catch.value.integer;
203
 
204
                                                INPUT_IVR[8]=G>>24;
205
                                                INPUT_IVR[9]=G>>16;
206
                                                INPUT_IVR[10]=G>>8;
207
                                                INPUT_IVR[11]=G;
208
                                        }
209
 
210
                                        if(v_monitor.value.integer == ADDR_AES_IVR0)
211
                                        {
212
                                                vpi_get_value(PWDATA, &v_monitor_catch);
213
                                                //printf("%X\n",v_monitor_catch.value.integer);
214
                                                H=v_monitor_catch.value.integer;
215
 
216
                                                INPUT_IVR[12]=H>>24;
217
                                                INPUT_IVR[13]=H>>16;
218
                                                INPUT_IVR[14]=H>>8;
219
                                                INPUT_IVR[15]=H;
220
 
221
                                        }
222
 
223
                                        if(v_monitor.value.integer == ADDR_AES_CR)
224
                                        {
225
                                                vpi_get_value(PWDATA, &v_monitor_catch);
226
                                                //printf("%X\n",v_monitor_catch.value.integer);
227
                                                I=v_monitor_catch.value.integer;
228
                                        }
229
 
230
                                        if(v_monitor.value.integer == ADDR_AES_DINR)
231
                                        {
232
                                                vpi_get_value(PWDATA, &v_monitor_catch);
233
                                                //printf("%X\n",v_monitor_catch.value.integer);
234
 
235
                                                if(counter_monitor == 0)
236
                                                {
237
 
238
                                                        J=v_monitor_catch.value.integer;
239
                                                        INPUT_TEXT[0]=J>>24;
240
                                                        INPUT_TEXT[1]=J>>16;
241
                                                        INPUT_TEXT[2]=J>>8;
242
                                                        INPUT_TEXT[3]=J;
243
 
244
                                                        counter_monitor++;
245
 
246
 
247
                                                }else if(counter_monitor == 1)
248
                                                {
249
 
250
                                                        L=v_monitor_catch.value.integer;
251
                                                        INPUT_TEXT[4]=L>>24;
252
                                                        INPUT_TEXT[5]=L>>16;
253
                                                        INPUT_TEXT[6]=L>>8;
254
                                                        INPUT_TEXT[7]=L;
255
 
256
                                                        counter_monitor++;
257
 
258
 
259
                                                }else if(counter_monitor == 2)
260
                                                {
261
 
262
                                                        M=v_monitor_catch.value.integer;
263
                                                        INPUT_TEXT[8]=M>>24;
264
                                                        INPUT_TEXT[9]=M>>16;
265
                                                        INPUT_TEXT[10]=M>>8;
266
                                                        INPUT_TEXT[11]=M;
267
 
268
                                                        counter_monitor++;
269
 
270
 
271
                                                }else if(counter_monitor == 3)
272
                                                {
273
 
274
                                                        N=v_monitor_catch.value.integer;
275
                                                        INPUT_TEXT[12]=N>>24;
276
                                                        INPUT_TEXT[13]=N>>16;
277
                                                        INPUT_TEXT[14]=N>>8;
278
                                                        INPUT_TEXT[15]=N;
279
 
280
                                                        counter_monitor=0;
281
                                                }
282
 
283
 
284
 
285
                                        }
286
 
287
                                }else if(v_monitor.value.integer == 0){
288
 
289
                                        vpi_get_value(PADDR, &v_monitor);
290
 
291
                                        if(v_monitor.value.integer == ADDR_AES_KEYR3)
292
                                        {
293
                                                vpi_get_value(PRDATA, &v_monitor_catch);
294
                                                //printf("%X\n",v_monitor_catch.value.integer);
295
                                                A=v_monitor_catch.value.integer;
296
 
297
                                                OUTPUT_KEYR[0]=A>>24;
298
                                                OUTPUT_KEYR[1]=A>>16;
299
                                                OUTPUT_KEYR[2]=A>>8;
300
                                                OUTPUT_KEYR[3]=A;
301
 
302
                                                counter_monitor++;
303
 
304
                                                //printf("%x%x%x%x\n",KEYR[0],KEYR[1],KEYR[2],KEYR[3]); 
305
                                        }
306
 
307
                                        if(v_monitor.value.integer == ADDR_AES_KEYR2)
308
                                        {
309
                                                vpi_get_value(PRDATA, &v_monitor_catch);
310
                                                //printf("%X\n",v_monitor_catch.value.integer);
311
                                                B=v_monitor_catch.value.integer;
312
 
313
                                                OUTPUT_KEYR[4]=B>>24;
314
                                                OUTPUT_KEYR[5]=B>>16;
315
                                                OUTPUT_KEYR[6]=B>>8;
316
                                                OUTPUT_KEYR[7]=B;
317
 
318
                                                counter_monitor++;
319
 
320
                                        }
321
 
322
                                        if(v_monitor.value.integer == ADDR_AES_KEYR1)
323
                                        {
324
                                                vpi_get_value(PRDATA, &v_monitor_catch);
325
                                                //printf("%X\n",v_monitor_catch.value.integer);
326
                                                C=v_monitor_catch.value.integer;
327
 
328
                                                OUTPUT_KEYR[8]=C>>24;
329
                                                OUTPUT_KEYR[9]=C>>16;
330
                                                OUTPUT_KEYR[10]=C>>8;
331
                                                OUTPUT_KEYR[11]=C;
332
 
333
                                                counter_monitor++;
334
 
335
 
336
                                        }
337
 
338
                                        if(v_monitor.value.integer == ADDR_AES_KEYR0)
339
                                        {
340
                                                vpi_get_value(PRDATA, &v_monitor_catch);
341
                                                //printf("%X\n",v_monitor_catch.value.integer);
342
                                                D=v_monitor_catch.value.integer;
343
 
344
                                                OUTPUT_KEYR[12]=D>>24;
345
                                                OUTPUT_KEYR[13]=D>>16;
346
                                                OUTPUT_KEYR[14]=D>>8;
347
                                                OUTPUT_KEYR[15]=D;
348
 
349
                                                counter_monitor++;
350
 
351
                                                        //printf("%x%x%x%x\n",KEYR[0],KEYR[1],KEYR[2],KEYR[3]);                                 
352
                                        }
353
 
354
                                        if(v_monitor.value.integer == ADDR_AES_IVR3)
355
                                        {
356
                                                vpi_get_value(PRDATA, &v_monitor_catch);
357
                                                //printf("%X\n",v_monitor_catch.value.integer);
358
                                                E=v_monitor_catch.value.integer;
359
 
360
                                                OUTPUT_IVR[0]=E>>24;
361
                                                OUTPUT_IVR[1]=E>>16;
362
                                                OUTPUT_IVR[2]=E>>8;
363
                                                OUTPUT_IVR[3]=E;
364
 
365
                                                counter_monitor++;
366
 
367
                                        }
368
 
369
                                        if(v_monitor.value.integer == ADDR_AES_IVR2)
370
                                        {
371
                                                vpi_get_value(PRDATA, &v_monitor_catch);
372
                                                //printf("%X\n",v_monitor_catch.value.integer);
373
                                                F=v_monitor_catch.value.integer;
374
 
375
                                                OUTPUT_IVR[4]=F>>24;
376
                                                OUTPUT_IVR[5]=F>>16;
377
                                                OUTPUT_IVR[6]=F>>8;
378
                                                OUTPUT_IVR[7]=F;
379
 
380
                                                counter_monitor++;
381
 
382
 
383
                                        }
384
 
385
                                        if(v_monitor.value.integer == ADDR_AES_IVR1)
386
                                        {
387
                                                vpi_get_value(PRDATA, &v_monitor_catch);
388
                                                //printf("%X\n",v_monitor_catch.value.integer);
389
                                                G=v_monitor_catch.value.integer;
390
 
391
                                                OUTPUT_IVR[8]=G>>24;
392
                                                OUTPUT_IVR[9]=G>>16;
393
                                                OUTPUT_IVR[10]=G>>8;
394
                                                OUTPUT_IVR[11]=G;
395
 
396
                                                counter_monitor++;
397
 
398
                                        }
399
 
400
                                        if(v_monitor.value.integer == ADDR_AES_IVR0)
401
                                        {
402
                                                vpi_get_value(PRDATA, &v_monitor_catch);
403
                                                //printf("%X\n",v_monitor_catch.value.integer);
404
                                                H=v_monitor_catch.value.integer;
405
 
406
                                                OUTPUT_IVR[12]=H>>24;
407
                                                OUTPUT_IVR[13]=H>>16;
408
                                                OUTPUT_IVR[14]=H>>8;
409
                                                OUTPUT_IVR[15]=H;
410
 
411
                                                counter_monitor++;
412
                                        }
413
 
414
 
415
                                        if(v_monitor.value.integer == ADDR_AES_DOUTR)
416
                                        {
417
 
418
                                                vpi_get_value(PRDATA, &v_monitor_catch);
419
                                                //vpi_put_value(PRDATA, &v_monitor_catch, &t_monitor, vpiTransportDelay);
420
                                                //printf("%X\n",v_monitor_catch.value.integer);
421
 
422
                                                if(counter_monitor == 0)
423
                                                {
424
 
425
                                                        J=v_monitor_catch.value.integer;
426
                                                        OUTPUT_TEXT[0]=J>>24;
427
                                                        OUTPUT_TEXT[1]=J>>16;
428
                                                        OUTPUT_TEXT[2]=J>>8;
429
                                                        OUTPUT_TEXT[3]=J;
430
 
431
                                                        counter_monitor++;
432
 
433
 
434
                                                }else if(counter_monitor == 1)
435
                                                {
436
                                                        L=v_monitor_catch.value.integer;
437
                                                        OUTPUT_TEXT[4]=L>>24;
438
                                                        OUTPUT_TEXT[5]=L>>16;
439
                                                        OUTPUT_TEXT[6]=L>>8;
440
                                                        OUTPUT_TEXT[7]=L;
441
 
442
                                                        counter_monitor++;
443
 
444
 
445
 
446
                                                }else if(counter_monitor == 2)
447
                                                {
448
 
449
                                                        M=v_monitor_catch.value.integer;
450
                                                        OUTPUT_TEXT[8]=M>>24;
451
                                                        OUTPUT_TEXT[9]=M>>16;
452
                                                        OUTPUT_TEXT[10]=M>>8;
453
                                                        OUTPUT_TEXT[11]=M;
454
 
455
                                                        counter_monitor++;
456
 
457
 
458
                                                }else if(counter_monitor == 3)
459
                                                {
460
 
461
                                                        N=v_monitor_catch.value.integer;
462
                                                        OUTPUT_TEXT[12]=N>>24;
463
                                                        OUTPUT_TEXT[13]=N>>16;
464
                                                        OUTPUT_TEXT[14]=N>>8;
465
                                                        OUTPUT_TEXT[15]=N;
466
 
467
                                                        counter_monitor++;
468
                                                }
469
 
470
 
471
                                        }
472
 
473
                                        // vpi_mcd_printf(1,"%d\n",counter_monitor);
474
 
475
 
476
                                        if(counter_monitor == 12 && FIPS_ENABLE == FIPS)
477
                                        {
478
                                                printf("Checking results\n\n");
479
                                                counter_monitor = 0;
480
 
481
                                                if(I == 4094)// WR
482
                                                {
483
                                                        if(memcmp(TEXT_NULL,OUTPUT_TEXT,16) == 0)
484
                                                        {
485
                                                                printf("WRITE READ: TEXT CR DISABLED PASSED.\n");
486
                                                        }else
487
                                                        {
488
                                                                printf("WRITE READ: TEXT CR DISABLED FAIL.\n");
489
                                                        }
490
 
491
                                                        if(memcmp(OUTPUT_KEYR,INPUT_KEYR,16) == 0)
492
                                                        {
493
                                                                        printf("WRITE READ: KEYR WHEN CR DISABLED PASSED.\n");
494
                                                        }else
495
                                                        {
496
                                                                printf("WRITE READ: KEYR WHEN CR DISABLED FAIL.\n");
497
                                                        }
498
 
499
                                                        if(memcmp(OUTPUT_IVR,INPUT_IVR,16) == 0)
500
                                                        {
501
                                                                printf("WRITE READ: IVR WHEN CR DISABLED PASSED.\n");
502
                                                        }else
503
                                                        {
504
                                                                printf("WRITE READ: IVR WHEN CR DISABLED FAIL.\n");
505
                                                        }
506
 
507
                                                }else if(I == 1)//ECB ENCRYPTION
508
                                                {
509
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DERIVATED,16) == 0)
510
                                                        {
511
                                                                printf("ECB ENCRYPTION: TEXT CYPHER PASSED.\n");
512
                                                        }else
513
                                                        {
514
                                                                printf("ECB ENCRYPTION: TEXT CYPHER FAIL.\n");
515
                                                        }
516
 
517
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
518
                                                        {
519
                                                                printf("ECB ENCRYPTION: KEYR WHEN CR ENABLE PASSED.\n");
520
                                                        }else
521
                                                        {
522
                                                                printf("ECB ENCRYPTION: KEYR WHEN CR ENABLE FAIL.\n");
523
                                                        }
524
 
525
 
526
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
527
                                                        {
528
                                                                printf("ECB ENCRYPTION: IVR WHEN CR ENABLE PASSED.\n");
529
                                                        }else
530
                                                        {
531
                                                                printf("ECB ENCRYPTION: IVR WHEN CR ENABLE FAIL.\n");
532
                                                        }
533
 
534
                                                }else if(I == 6145 ) //ECB ENCRYPTION DMA
535
                                                {
536
 
537
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DERIVATED,16) == 0)
538
                                                        {
539
                                                                printf("ECB ENCRYPTION DMA: TEXT CYPHER  WHEN CR ENABLE PASSED.\n");
540
 
541
                                                        }else
542
                                                        {
543
                                                                printf("ECB ENCRYPTION DMA: TEXT CYPHER WHEN CR ENABLE FAIL.\n");
544
                                                        }
545
 
546
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
547
                                                        {
548
                                                                printf("ECB ENCRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n");
549
                                                        }else
550
                                                        {
551
                                                                printf("ECB ENCRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n");
552
                                                        }
553
 
554
 
555
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
556
                                                        {
557
                                                                printf("ECB ENCRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n");
558
                                                        }else
559
                                                        {
560
                                                                printf("ECB ENCRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n");
561
                                                        }
562
 
563
                                                }else if (I == 513) // ECB ENCRYPTION CCFIE
564
                                                {
565
 
566
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DERIVATED,16) == 0)
567
                                                        {
568
                                                                printf("ECB ENCRYPTION CCFIE: TEXT CYPHER PASSED.\n");
569
 
570
                                                        }else
571
                                                        {
572
                                                                printf("ECB ENCRYPTION CCFIE: TEXT CYPHER FAIL.\n");
573
                                                        }
574
 
575
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
576
                                                        {
577
                                                                printf("ECB ENCRYPTION CCFIE: KEYR WHEN CR ENABLE PASSED.\n");
578
                                                        }else
579
                                                        {
580
                                                                printf("ECB ENCRYPTION CCFIE: KEYR WHEN CR ENABLE FAIL.\n");
581
                                                        }
582
 
583
 
584
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
585
                                                        {
586
                                                                printf("ECB ENCRYPTION CCFIE: IVR WHEN CR ENABLE PASSED.\n");
587
                                                        }else
588
                                                        {
589
                                                                printf("ECB ENCRYPTION CCFIE: IVR WHEN CR ENABLE FAIL.\n");
590
                                                        }
591
 
592
                                                }else if(I == 25)// ECB DERIVATION DECRYPTION
593
                                                {
594
 
595
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0)
596
                                                        {
597
                                                                printf("ECB DERIVATION DECRYPTION: TEXT CYPHER PASSED.\n");
598
 
599
                                                        }else
600
                                                        {
601
                                                                printf("ECB DERIVATION DECRYPTION: TEXT CYPHER FAIL.\n");
602
                                                        }
603
 
604
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
605
                                                        {
606
                                                                printf("ECB DERIVATION DECRYPTION: KEYR WHEN CR ENABLE PASSED.\n");
607
                                                        }else
608
                                                        {
609
                                                                printf("ECB DERIVATION DECRYPTION: KEYR WHEN CR ENABLE FAIL.\n");
610
                                                        }
611
 
612
 
613
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
614
                                                        {
615
                                                                printf("ECB DERIVATION DECRYPTION: IVR WHEN CR ENABLE PASSED.\n");
616
                                                        }else
617
                                                        {
618
                                                                printf("ECB DERIVATION DECRYPTION: IVR WHEN CR ENABLE FAIL.\n");
619
                                                        }
620
 
621
                                                }else if(I == 6169)// ECB DERIVATION DECRYPTION DMA
622
                                                {
623
 
624
 
625
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0)
626
                                                        {
627
                                                                printf("ECB DERIVATION DECRYPTION DMA: TEXT CYPHER PASSED.\n");
628
 
629
                                                        }else
630
                                                        {
631
                                                                printf("ECB DERIVATION DECRYPTION DMA: TEXT CYPHER FAIL.\n");
632
                                                        }
633
 
634
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
635
                                                        {
636
                                                                printf("ECB DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n");
637
                                                        }else
638
                                                        {
639
                                                                printf("ECB DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n");
640
                                                        }
641
 
642
 
643
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
644
                                                        {
645
                                                                printf("ECB DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n");
646
                                                        }else
647
                                                        {
648
                                                                printf("ECB DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n");
649
                                                        }
650
 
651
                                                }else if(I == 537)// ECB DERIVATION DECRYPTION CCFIE
652
                                                {
653
 
654
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0)
655
                                                        {
656
                                                                printf("ECB DERIVATION DECRYPTION DMA: TEXT CYPHER PASSED.\n");
657
 
658
                                                        }else
659
                                                        {
660
                                                                printf("ECB DERIVATION DECRYPTION DMA: TEXT CYPHER FAIL.\n");
661
                                                        }
662
 
663
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
664
                                                        {
665
                                                                printf("ECB DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n");
666
                                                        }else
667
                                                        {
668
                                                                printf("ECB DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n");
669
                                                        }
670
 
671
 
672
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
673
                                                        {
674
                                                                printf("ECB DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n");
675
                                                        }else
676
                                                        {
677
                                                                printf("ECB DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n");
678
                                                        }
679
 
680
                                                }else if(I == 17)//ECB DECRYPTION
681
                                                {
682
 
683
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0)
684
                                                        {
685
                                                                printf("ECB DECRYPTION: TEXT CYPHER PASSED.\n");
686
 
687
                                                        }else
688
                                                        {
689
                                                                printf("ECB DECRYPTION: TEXT CYPHER FAIL.\n");
690
                                                        }
691
 
692
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
693
                                                        {
694
                                                                printf("ECB DECRYPTION: KEYR WHEN CR ENABLE PASSED.\n");
695
                                                        }else
696
                                                        {
697
                                                                printf("ECB DECRYPTION: KEYR WHEN CR ENABLE FAIL.\n");
698
                                                        }
699
 
700
 
701
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
702
                                                        {
703
                                                                printf("ECB DECRYPTION: IVR WHEN CR ENABLE PASSED.\n");
704
                                                        }else
705
                                                        {
706
                                                                printf("ECB DECRYPTION: IVR WHEN CR ENABLE FAIL.\n");
707
                                                        }
708
 
709
 
710
                                                }else if(I == 6161)//ECB DECRYPTION DMA
711
                                                {
712
 
713
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0)
714
                                                        {
715
                                                                printf("ECB DECRYPTION DMA: TEXT CYPHER PASSED.\n");
716
 
717
                                                        }else
718
                                                        {
719
                                                                printf("ECB DECRYPTION DMA: TEXT CYPHER FAIL.\n");
720
                                                        }
721
 
722
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
723
                                                        {
724
                                                                printf("ECB DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n");
725
                                                        }else
726
                                                        {
727
                                                                printf("ECB DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n");
728
                                                        }
729
 
730
 
731
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
732
                                                        {
733
                                                                printf("ECB DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n");
734
                                                        }else
735
                                                        {
736
                                                                printf("ECB DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n");
737
                                                        }
738
                                                }else if(I == 529)//ECB DECRYPTION CCFIE
739
                                                {
740
 
741
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0)
742
                                                        {
743
                                                                printf("ECB DECRYPTION CCFIE: TEXT CYPHER PASSED.\n");
744
 
745
                                                        }else
746
                                                        {
747
                                                                printf("ECB DECRYPTION CCFIE: TEXT CYPHER FAIL.\n");
748
                                                        }
749
 
750
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
751
                                                        {
752
                                                                printf("ECB DECRYPTION CCFIE: KEYR WHEN CR ENABLE PASSED.\n");
753
                                                        }else
754
                                                        {
755
                                                                printf("ECB DECRYPTION CCFIE: KEYR WHEN CR ENABLE FAIL.\n");
756
                                                        }
757
 
758
 
759
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
760
                                                        {
761
                                                                printf("ECB DECRYPTION CCFIE: IVR WHEN CR ENABLE PASSED.\n");
762
                                                        }else
763
                                                        {
764
                                                                printf("ECB DECRYPTION CCFIE: IVR WHEN CR ENABLE FAIL.\n");
765
                                                        }
766
 
767
                                                }else if(I == 9) //ECB KEY GENARATION
768
                                                {
769
 
770
 
771
                                                        if(memcmp(OUTPUT_TEXT,TEXT_NULL,16) == 0)
772
                                                        {
773
                                                                printf("ECB KEY GEN : TEXT CYPHER PASSED.\n");
774
 
775
                                                        }else
776
                                                        {
777
                                                                printf("ECB KEY GEN : TEXT CYPHER FAIL.\n");
778
                                                        }
779
 
780
 
781
                                                        if(memcmp(OUTPUT_KEYR,KEY_FIPS_DERIVATED,16) == 0)
782
                                                        {
783
                                                                printf("ECB KEY GEN: KEYR WHEN CR ENABLE PASSED.\n");
784
                                                        }else
785
                                                        {
786
                                                                printf("ECB KEY GEN: KEYR WHEN CR ENABLE FAIL.\n");
787
                                                        }
788
 
789
 
790
                                                        if(memcmp(OUTPUT_IVR,KEY_FIPS_NOT_DERIVATED,16) == 0)
791
                                                        {
792
                                                                printf("ECB KEY GEN: IVR WHEN CR ENABLE PASSED.\n");
793
                                                        }else
794
                                                        {
795
                                                                printf("ECB KEY GEN: IVR WHEN CR ENABLE FAIL.\n");
796
                                                        }
797
 
798
                                                }else if(I == 6153)// ECB KEY GENARATION DMA
799
                                                {
800
 
801
                                                        if(memcmp(OUTPUT_TEXT,TEXT_NULL,16) == 0)
802
                                                        {
803
                                                                printf("ECB KEY GEN DMA: TEXT CYPHER PASSED.\n");
804
 
805
                                                        }else
806
                                                        {
807
                                                                printf("ECB KEY GEN DMA: TEXT CYPHER FAIL.\n");
808
                                                        }
809
 
810
                                                        if(memcmp(OUTPUT_KEYR,KEY_FIPS_DERIVATED,16) == 0)
811
                                                        {
812
                                                                printf("ECB KEY GEN DMA: KEYR WHEN CR ENABLE PASSED.\n");
813
                                                        }else
814
                                                        {
815
                                                                printf("ECB KEY GEN DMA: KEYR WHEN CR ENABLE FAIL.\n");
816
                                                        }
817
 
818
                                                        if(memcmp(OUTPUT_IVR,KEY_FIPS_NOT_DERIVATED,16) == 0)
819
                                                        {
820
                                                                printf("ECB KEY GEN DMA: IVR WHEN CR ENABLE PASSED.\n");
821
                                                        }else
822
                                                        {
823
                                                                printf("ECB KEY GEN DMA: IVR WHEN CR ENABLE FAIL.\n");
824
                                                        }
825
 
826
                                                }else if(I == 521)// ECB KEY GENARATION CCFIE
827
                                                {
828
 
829
                                                        if(memcmp(OUTPUT_TEXT,TEXT_NULL,16) == 0)
830
                                                        {
831
                                                                printf("ECB KEY GEN CCFIE: TEXT CYPHER PASSED.\n");
832
 
833
                                                        }else
834
                                                        {
835
                                                                printf("ECB KEY GEN CCFIE: TEXT CYPHER FAIL.\n");
836
                                                        }
837
 
838
                                                        if(memcmp(OUTPUT_KEYR,KEY_FIPS_DERIVATED,16) == 0)
839
                                                        {
840
                                                                printf("ECB KEY GEN CCFIE: KEYR WHEN CR ENABLE PASSED.\n");
841
                                                        }else
842
                                                        {
843
                                                                printf("ECB KEY GEN CCFIE: KEYR WHEN CR ENABLE FAIL.\n");
844
                                                        }
845
 
846
                                                        if(memcmp(OUTPUT_IVR,KEY_FIPS_NOT_DERIVATED,16) == 0)
847
                                                        {
848
                                                                printf("ECB KEY GEN CCFIE: IVR WHEN CR ENABLE PASSED.\n");
849
                                                        }else
850
                                                        {
851
                                                                printf("ECB KEY GEN CCFIE: IVR WHEN CR ENABLE FAIL.\n");
852
                                                        }
853
 
854
                                                }else if(I == 33) // ENCRYPTION CBC
855
                                                {
856
 
857
                                                        if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DERIVATED,16) == 0)
858
                                                        {
859
                                                                printf("CBC ENCRYPTION: TEXT CYPHER PASSED.\n");
860
 
861
                                                        }else
862
                                                        {
863
                                                                printf("CBC ENCRYPTION: TEXT CYPHER FAIL.\n");
864
                                                        }
865
 
866
 
867
 
868
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
869
                                                        {
870
                                                                printf("CBC ENCRYPTION: KEYR WHEN CR ENABLE PASSED.\n");
871
                                                        }else
872
                                                        {
873
                                                                printf("CBC ENCRYPTION: KEYR WHEN CR ENABLE FAIL.\n");
874
                                                        }
875
 
876
 
877
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
878
                                                        {
879
                                                                printf("CBC ENCRYPTION: IVR WHEN CR ENABLE PASSED.\n");
880
                                                        }else
881
                                                        {
882
                                                                printf("CBC ENCRYPTION: IVR WHEN CR ENABLE FAIL.\n");
883
                                                        }
884
 
885
                                                }else if(I == 6177)//CBC ENCRYPTION DMA
886
                                                {
887
 
888
                                                        if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DERIVATED,16) == 0)
889
                                                        {
890
                                                                printf("CBC ENCRYPTION DMA: TEXT CYPHER PASSED.\n");
891
 
892
                                                        }else
893
                                                        {
894
                                                                printf("CBC ENCRYPTION DMA: TEXT CYPHER FAIL.\n");
895
                                                        }
896
 
897
 
898
 
899
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
900
                                                        {
901
                                                                printf("CBC ENCRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n");
902
                                                        }else
903
                                                        {
904
                                                                printf("CBC ENCRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n");
905
                                                        }
906
 
907
 
908
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
909
                                                        {
910
                                                                printf("CBC ENCRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n");
911
                                                        }else
912
                                                        {
913
                                                                printf("CBC ENCRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n");
914
                                                        }
915
 
916
                                                }else if(I == 545)//CBC ENCRYPTION CCFIE
917
                                                {
918
 
919
                                                        if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DERIVATED,16) == 0)
920
                                                        {
921
                                                                printf("CBC ENCRYPTION CCFIE: TEXT CYPHER PASSED.\n");
922
 
923
                                                        }else
924
                                                        {
925
                                                                printf("CBC ENCRYPTION CCFIE: TEXT CYPHER FAIL.\n");
926
                                                        }
927
 
928
 
929
 
930
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
931
                                                        {
932
                                                                printf("CBC ENCRYPTION CCFIE: KEYR WHEN CR ENABLE PASSED.\n");
933
                                                        }else
934
                                                        {
935
                                                                printf("CBC ENCRYPTION CCFIE: KEYR WHEN CR ENABLE FAIL.\n");
936
                                                        }
937
 
938
 
939
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
940
                                                        {
941
                                                                printf("CBC ENCRYPTION CCFIE: IVR WHEN CR ENABLE PASSED.\n");
942
                                                        }else
943
                                                        {
944
                                                                printf("CBC ENCRYPTION CCFIE: IVR WHEN CR ENABLE FAIL.\n");
945
                                                        }
946
 
947
                                                }else if(I == 49)// CBC DECRYPTION
948
                                                {
949
 
950
 
951
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0)
952
                                                        {
953
                                                                printf("CBC DECRYPTION : TEXT CYPHER PASSED.\n");
954
 
955
                                                        }else
956
                                                        {
957
                                                                printf("CBC DECRYPTION : TEXT CYPHER FAIL.\n");
958
 
959
                                                        }
960
 
961
 
962
 
963
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
964
                                                        {
965
                                                                printf("CBC DECRYPTION : KEYR WHEN CR ENABLE PASSED.\n");
966
                                                        }else
967
                                                        {
968
                                                                printf("CBC DECRYPTION : KEYR WHEN CR ENABLE FAIL.\n");
969
                                                        }
970
 
971
 
972
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
973
                                                        {
974
                                                                printf("CBC DECRYPTION : IVR WHEN CR ENABLE PASSED.\n");
975
                                                        }else
976
                                                        {
977
                                                                printf("CBC DECRYPTION : IVR WHEN CR ENABLE FAIL.\n");
978
                                                        }
979
 
980
 
981
 
982
                                                }else if(I == 3121)//CBC DECRYPTION DMA 
983
                                                {
984
 
985
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0)
986
                                                        {
987
                                                                printf("CBC DECRYPTION DMA : TEXT CYPHER PASSED.\n");
988
 
989
                                                        }else
990
                                                        {
991
                                                                printf("CBC DECRYPTION DMA : TEXT CYPHER FAIL.\n");
992
 
993
                                                        }
994
 
995
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
996
                                                        {
997
                                                                printf("CBC DECRYPTION DMA : KEYR WHEN CR ENABLE PASSED.\n");
998
                                                        }else
999
                                                        {
1000
                                                                printf("CBC DECRYPTION DMA : KEYR WHEN CR ENABLE FAIL.\n");
1001
                                                        }
1002
 
1003
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1004
                                                        {
1005
                                                                printf("CBC DECRYPTION DMA  : IVR WHEN CR ENABLE PASSED.\n");
1006
                                                        }else
1007
                                                        {
1008
                                                                printf("CBC DECRYPTION DMA  : IVR WHEN CR ENABLE FAIL.\n");
1009
                                                        }
1010
 
1011
                                                }else if(I == 561)// CBC DECRYPTION CCFIE
1012
                                                {
1013
 
1014
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0)
1015
                                                        {
1016
                                                                printf("CBC DECRYPTION  : TEXT CYPHER PASSED.\n");
1017
 
1018
                                                        }else
1019
                                                        {
1020
                                                                printf("CBC DECRYPTION  : TEXT CYPHER FAIL.\n");
1021
 
1022
                                                        }
1023
 
1024
 
1025
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1026
                                                        {
1027
                                                                printf("CBC DECRYPTION  : KEYR WHEN CR ENABLE PASSED.\n");
1028
                                                        }else
1029
                                                        {
1030
                                                                printf("CBC DECRYPTION  : KEYR WHEN CR ENABLE FAIL.\n");
1031
                                                        }
1032
 
1033
 
1034
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1035
                                                        {
1036
                                                                printf("CBC DECRYPTION  : IVR WHEN CR ENABLE PASSED.\n");
1037
                                                        }else
1038
                                                        {
1039
                                                                printf("CBC DECRYPTION  : IVR WHEN CR ENABLE FAIL.\n");
1040
                                                        }
1041
 
1042
                                                }else if(I == 41) //CBC KEY GENERATION
1043
                                                {
1044
 
1045
 
1046
                                                        if(memcmp(OUTPUT_TEXT,TEXT_NULL,16) == 0)
1047
                                                        {
1048
                                                                printf("CBC KEY GEN  : TEXT CYPHER PASSED.\n");
1049
 
1050
                                                        }else
1051
                                                        {
1052
                                                                printf("CBC KEY GEN  : TEXT CYPHER FAIL.\n");
1053
 
1054
                                                        }
1055
 
1056
                                                        if(memcmp(OUTPUT_KEYR,KEY_FIPS_CBC_DERIVATED,16) == 0)
1057
                                                        {
1058
                                                                printf("CBC KEY GEN  : KEYR WHEN CR ENABLE PASSED.\n");
1059
                                                        }else
1060
                                                        {
1061
                                                                printf("CBC KEY GEN  : KEYR WHEN CR ENABLE FAIL.\n");
1062
                                                        }
1063
 
1064
                                                        if(memcmp(OUTPUT_IVR,IV_FIPS_CBC_NOT_DERIVATED,16) == 0)
1065
                                                        {
1066
                                                                printf("CBC KEY GEN  : IVR WHEN CR ENABLE PASSED.\n");
1067
                                                        }else
1068
                                                        {
1069
                                                                printf("CBC KEY GEN  : IVR WHEN CR ENABLE FAIL.\n");
1070
                                                        }
1071
 
1072
 
1073
 
1074
                                                }else if(I == 6185) //CBC KEY GENERATION DMA
1075
                                                {
1076
 
1077
                                                        if(memcmp(OUTPUT_TEXT,TEXT_NULL,16) == 0)
1078
                                                        {
1079
                                                                printf("CBC KEY GEN DMA : TEXT CYPHER PASSED.\n");
1080
 
1081
                                                        }else
1082
                                                        {
1083
                                                                printf("CBC KEY GEN DMA : TEXT CYPHER FAIL.\n");
1084
                                                        }
1085
 
1086
                                                        if(memcmp(OUTPUT_KEYR,KEY_FIPS_CBC_DERIVATED,16) == 0)
1087
                                                        {
1088
                                                                printf("CBC KEY GEN DMA : KEYR WHEN CR ENABLE PASSED.\n");
1089
                                                        }else
1090
                                                        {
1091
                                                                printf("CBC KEY GEN DMA : KEYR WHEN CR ENABLE FAIL.\n");
1092
                                                        }
1093
 
1094
                                                        if(memcmp(OUTPUT_IVR,IV_FIPS_CBC_NOT_DERIVATED,16) == 0)
1095
                                                        {
1096
                                                                printf("CBC KEY GEN DMA : IVR WHEN CR ENABLE PASSED.\n");
1097
                                                        }else
1098
                                                        {
1099
                                                                printf("CBC KEY GEN DMA : IVR WHEN CR ENABLE FAIL.\n");
1100
                                                        }
1101
 
1102
                                                }else if(I == 297 ) //CBC KEY GENERATION CCFIE 
1103
                                                {
1104
 
1105
 
1106
                                                        if(memcmp(OUTPUT_TEXT,TEXT_NULL,16) == 0)
1107
                                                        {
1108
                                                                printf("CBC KEY GEN CCFIE : TEXT CYPHER PASSED.\n");
1109
 
1110
                                                        }else
1111
                                                        {
1112
                                                                printf("CBC KEY GEN CCFIE : TEXT CYPHER FAIL.\n");
1113
                                                        }
1114
 
1115
                                                        if(memcmp(OUTPUT_KEYR,KEY_FIPS_CBC_DERIVATED,16) == 0)
1116
                                                        {
1117
                                                                printf("CBC KEY GEN CCFIE : KEYR WHEN CR ENABLE PASSED.\n");
1118
                                                        }else
1119
                                                        {
1120
                                                                printf("CBC KEY GEN CCFIE : KEYR WHEN CR ENABLE FAIL.\n");
1121
                                                        }
1122
 
1123
                                                        if(memcmp(OUTPUT_IVR,IV_FIPS_CBC_NOT_DERIVATED,16) == 0)
1124
                                                        {
1125
                                                                printf("CBC KEY GEN CCFIE : IVR WHEN CR ENABLE PASSED.\n");
1126
                                                        }else
1127
                                                        {
1128
                                                                printf("CBC KEY GEN CCFIE : IVR WHEN CR ENABLE FAIL.\n");
1129
                                                        }
1130
 
1131
                                                }else if(I == 57)// CBC DERIVATION DECRYPTION
1132
                                                {
1133
 
1134
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0)
1135
                                                        {
1136
                                                                printf("CBC DERIVATION DECRYPTION : TEXT CYPHER PASSED.\n");
1137
 
1138
                                                        }else
1139
                                                        {
1140
                                                                printf("CBC DERIVATION DECRYPTION : TEXT CYPHER FAIL.\n");
1141
                                                        }
1142
 
1143
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1144
                                                        {
1145
                                                                printf("CBC DERIVATION DECRYPTION : KEYR WHEN CR ENABLE PASSED.\n");
1146
                                                        }else
1147
                                                        {
1148
                                                                printf("CBC DERIVATION DECRYPTION : KEYR WHEN CR ENABLE FAIL.\n");
1149
                                                        }
1150
 
1151
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1152
                                                        {
1153
                                                                printf("CBC DERIVATION DECRYPTION : IVR WHEN CR ENABLE PASSED.\n");
1154
                                                        }else
1155
                                                        {
1156
                                                                printf("CBC DERIVATION DECRYPTION : IVR WHEN CR ENABLE FAIL.\n");
1157
                                                        }
1158
 
1159
                                                }else if(I == 6201) // CBC DERIVATION DECRYPTION DMA
1160
                                                {
1161
 
1162
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0)
1163
                                                        {
1164
                                                                printf("CBC DERIVATION DECRYPTION DMA : TEXT CYPHER PASSED.\n");
1165
 
1166
                                                        }else
1167
                                                        {
1168
                                                                printf("CBC DERIVATION DECRYPTION DMA : TEXT CYPHER FAIL.\n");
1169
                                                        }
1170
 
1171
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1172
                                                        {
1173
                                                                printf("CBC DERIVATION DECRYPTION DMA : KEYR WHEN CR ENABLE PASSED.\n");
1174
                                                        }else
1175
                                                        {
1176
                                                                printf("CBC DERIVATION DECRYPTION DMA : KEYR WHEN CR ENABLE FAIL.\n");
1177
                                                        }
1178
 
1179
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1180
                                                        {
1181
                                                                printf("CBC DERIVATION DECRYPTION DMA : IVR WHEN CR ENABLE PASSED.\n");
1182
                                                        }else
1183
                                                        {
1184
                                                                printf("CBC DERIVATION DECRYPTION DMA : IVR WHEN CR ENABLE FAIL.\n");
1185
                                                        }
1186
 
1187
                                                }else if(I == 569) // CBC DERIVATION DECRYPTION CCFIE
1188
                                                {
1189
 
1190
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0)
1191
                                                        {
1192
                                                                printf("CBC DERIVATION DECRYPTION CCFIE : TEXT CYPHER PASSED.\n");
1193
 
1194
                                                        }else
1195
                                                        {
1196
                                                                printf("CBC DERIVATION DECRYPTION CCFIE : TEXT CYPHER FAIL.\n");
1197
                                                        }
1198
 
1199
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1200
                                                        {
1201
                                                                printf("CBC DERIVATION DECRYPTION CCFIE : KEYR WHEN CR ENABLE PASSED.\n");
1202
                                                        }else
1203
                                                        {
1204
                                                                printf("CBC DERIVATION DECRYPTION CCFIE : KEYR WHEN CR ENABLE FAIL.\n");
1205
                                                        }
1206
 
1207
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1208
                                                        {
1209
                                                                printf("CBC DERIVATION DECRYPTION CCFIE : IVR WHEN CR ENABLE PASSED.\n");
1210
                                                        }else
1211
                                                        {
1212
                                                                printf("CBC DERIVATION DECRYPTION CCFIE : IVR WHEN CR ENABLE FAIL.\n");
1213
                                                        }
1214
 
1215
 
1216
                                                }else if(I == 65)// CTR ENCFRYPTION
1217
                                                {
1218
 
1219
 
1220
                                                        if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DERIVATED,16) == 0)
1221
                                                        {
1222
                                                                printf("CTR ENCRYPTION: TEXT CYPHER PASSED.\n");
1223
 
1224
                                                        }else
1225
                                                        {
1226
                                                                printf("CTR ENCRYPTION: TEXT CYPHER FAIL.\n");
1227
                                                        }
1228
 
1229
 
1230
 
1231
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1232
                                                        {
1233
                                                                printf("CTR ENCRYPTION: KEYR WHEN CR ENABLE PASSED.\n");
1234
                                                        }else
1235
                                                        {
1236
                                                                printf("CTR ENCRYPTION: KEYR WHEN CR ENABLE FAIL.\n");
1237
                                                        }
1238
 
1239
 
1240
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1241
                                                        {
1242
                                                                printf("CTR ENCRYPTION: IVR WHEN CR ENABLE PASSED.\n");
1243
                                                        }else
1244
                                                        {
1245
                                                                printf("CTR ENCRYPTION: IVR WHEN CR ENABLE FAIL.\n");
1246
                                                        }
1247
 
1248
 
1249
 
1250
                                                }else if(I == 6209)// CTR ENCRYPTION DMA
1251
                                                {
1252
 
1253
 
1254
                                                        if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DERIVATED,16) == 0)
1255
                                                        {
1256
                                                                printf("CTR ENCRYPTION DMA: TEXT CYPHER PASSED.\n");
1257
 
1258
                                                        }else
1259
                                                        {
1260
                                                                printf("CTR ENCRYPTION DMA: TEXT CYPHER FAIL.\n");
1261
                                                        }
1262
 
1263
 
1264
 
1265
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1266
                                                        {
1267
                                                                printf("CTR ENCRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n");
1268
                                                        }else
1269
                                                        {
1270
                                                                printf("CTR ENCRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n");
1271
                                                        }
1272
 
1273
 
1274
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1275
                                                        {
1276
                                                                printf("CTR ENCRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n");
1277
                                                        }else
1278
                                                        {
1279
                                                                printf("CTR ENCRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n");
1280
                                                        }
1281
 
1282
 
1283
                                                }else if(I == 577)// CTR ENCRYPTION CCFIE
1284
                                                {
1285
 
1286
                                                        if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DERIVATED,16) == 0)
1287
                                                        {
1288
                                                                printf("CTR ENCRYPTION CCFIE: TEXT CYPHER PASSED.\n");
1289
 
1290
                                                        }else
1291
                                                        {
1292
                                                                printf("CTR ENCRYPTION CCFIE: TEXT CYPHER FAIL.\n");
1293
                                                        }
1294
 
1295
 
1296
 
1297
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1298
                                                        {
1299
                                                                printf("CTR ENCRYPTION CCFIE: KEYR WHEN CR ENABLE PASSED.\n");
1300
                                                        }else
1301
                                                        {
1302
                                                                printf("CTR ENCRYPTION CCFIE: KEYR WHEN CR ENABLE FAIL.\n");
1303
                                                        }
1304
 
1305
 
1306
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1307
                                                        {
1308
                                                                printf("CTR ENCRYPTION CCFIE: IVR WHEN CR ENABLE PASSED.\n");
1309
                                                        }else
1310
                                                        {
1311
                                                                printf("CTR ENCRYPTION CCFIE: IVR WHEN CR ENABLE FAIL.\n");
1312
                                                        }
1313
 
1314
 
1315
                                                }else if(I == 81) //CTR DECRYPTION
1316
                                                {
1317
 
1318
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0)
1319
                                                        {
1320
                                                                printf("CTR DECRYPTION : TEXT CYPHER PASSED.\n");
1321
 
1322
                                                        }else
1323
                                                        {
1324
                                                                printf("CTR DECRYPTION : TEXT CYPHER FAIL.\n");
1325
                                                        }
1326
 
1327
 
1328
 
1329
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1330
                                                        {
1331
                                                                printf("CTR DECRYPTION : KEYR WHEN CR ENABLE PASSED.\n");
1332
                                                        }else
1333
                                                        {
1334
                                                                printf("CTR DECRYPTION : KEYR WHEN CR ENABLE FAIL.\n");
1335
                                                        }
1336
 
1337
 
1338
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1339
                                                        {
1340
                                                                printf("CTR DECRYPTION : IVR WHEN CR ENABLE PASSED.\n");
1341
                                                        }else
1342
                                                        {
1343
                                                                printf("CTR DECRYPTION : IVR WHEN CR ENABLE FAIL.\n");
1344
                                                        }
1345
 
1346
                                                }else if(I == 6225) //CTR DECRYPTION DMA
1347
                                                {
1348
 
1349
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0)
1350
                                                        {
1351
                                                                printf("CTR DECRYPTION DMA: TEXT CYPHER PASSED.\n");
1352
 
1353
                                                        }else
1354
                                                        {
1355
                                                                printf("CTR DECRYPTION DMA: TEXT CYPHER FAIL.\n");
1356
                                                        }
1357
 
1358
 
1359
 
1360
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1361
                                                        {
1362
                                                                printf("CTR DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n");
1363
                                                        }else
1364
                                                        {
1365
                                                                printf("CTR DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n");
1366
                                                        }
1367
 
1368
 
1369
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1370
                                                        {
1371
                                                                printf("CTR DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n");
1372
                                                        }else
1373
                                                        {
1374
                                                                printf("CTR DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n");
1375
                                                        }
1376
 
1377
 
1378
                                                }else if(I == 593) //CTR DECRYPTION CCFIE
1379
                                                {
1380
 
1381
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0)
1382
                                                        {
1383
                                                                printf("CTR DECRYPTION CCFIE: TEXT CYPHER PASSED.\n");
1384
 
1385
                                                        }else
1386
                                                        {
1387
                                                                printf("CTR DECRYPTION CCFIE: TEXT CYPHER FAIL.\n");
1388
                                                        }
1389
 
1390
 
1391
 
1392
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1393
                                                        {
1394
                                                                printf("CTR DECRYPTION CCFIE: KEYR WHEN CR ENABLE PASSED.\n");
1395
                                                        }else
1396
                                                        {
1397
                                                                printf("CTR DECRYPTION CCFIE: KEYR WHEN CR ENABLE FAIL.\n");
1398
                                                        }
1399
 
1400
 
1401
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1402
                                                        {
1403
                                                                printf("CTR DECRYPTION CCFIE: IVR WHEN CR ENABLE PASSED.\n");
1404
                                                        }else
1405
                                                        {
1406
                                                                printf("CTR DECRYPTION CCFIE: IVR WHEN CR ENABLE FAIL.\n");
1407
                                                        }
1408
 
1409
 
1410
                                                }else if(I == 89) //CTR DERIVATION DECRYPTION
1411
                                                {
1412
 
1413
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0)
1414
                                                        {
1415
                                                                printf("CTR DERIVATION DECRYPTION: TEXT CYPHER PASSED.\n");
1416
 
1417
                                                        }else
1418
                                                        {
1419
                                                                printf("CTR DERIVATION DECRYPTION: TEXT CYPHER FAIL.\n");
1420
                                                        }
1421
 
1422
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1423
                                                        {
1424
                                                                printf("CTR DERIVATION DECRYPTION: KEYR WHEN CR ENABLE PASSED.\n");
1425
                                                        }else
1426
                                                        {
1427
                                                                printf("CTR DERIVATION DECRYPTION: KEYR WHEN CR ENABLE FAIL.\n");
1428
                                                        }
1429
 
1430
 
1431
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1432
                                                        {
1433
                                                                printf("CTR DERIVATION DECRYPTION: IVR WHEN CR ENABLE PASSED.\n");
1434
                                                        }else
1435
                                                        {
1436
                                                                printf("CTR DERIVATION DECRYPTION: IVR WHEN CR ENABLE FAIL.\n");
1437
                                                        }
1438
 
1439
                                                }else if(I == 6233) //CTR DERIVATION DECRYPTION DMA
1440
                                                {
1441
 
1442
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0)
1443
                                                        {
1444
                                                                printf("CTR DERIVATION DECRYPTION DMA: TEXT CYPHER PASSED.\n");
1445
 
1446
                                                        }else
1447
                                                        {
1448
                                                                printf("CTR DERIVATION DECRYPTION DMA: TEXT CYPHER FAIL.\n");
1449
                                                        }
1450
 
1451
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1452
                                                        {
1453
                                                                printf("CTR DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n");
1454
                                                        }else
1455
                                                        {
1456
                                                                printf("CTR DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n");
1457
                                                        }
1458
 
1459
 
1460
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1461
                                                        {
1462
                                                                printf("CTR DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n");
1463
                                                        }else
1464
                                                        {
1465
                                                                printf("CTR DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n");
1466
                                                        }
1467
 
1468
                                                }else if(I == 601) //CTR DERIVATION DECRYPTION CCFIE
1469
                                                {
1470
 
1471
                                                        if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0)
1472
                                                        {
1473
                                                                printf("CTR DERIVATION DECRYPTION DMA: TEXT CYPHER PASSED.\n");
1474
 
1475
                                                        }else
1476
                                                        {
1477
                                                                printf("CTR DERIVATION DECRYPTION DMA: TEXT CYPHER FAIL.\n");
1478
                                                        }
1479
 
1480
                                                        if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0)
1481
                                                        {
1482
                                                                printf("CTR DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n");
1483
                                                        }else
1484
                                                        {
1485
                                                                printf("CTR DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n");
1486
                                                        }
1487
 
1488
 
1489
                                                        if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0)
1490
                                                        {
1491
                                                                printf("CTR DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n");
1492
                                                        }else
1493
                                                        {
1494
                                                                printf("CTR DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n");
1495
                                                        }
1496
 
1497
                                                }else if(I == 73)// CTR KEY GENERATION
1498
                                                {
1499
 
1500
                                                        if(memcmp(OUTPUT_TEXT,TEXT_NULL,16) == 0)
1501
                                                        {
1502
                                                                printf("CTR KEY GEN: TEXT CYPHER PASSED.\n");
1503
 
1504
                                                        }else
1505
                                                        {
1506
                                                                printf("CTR KEY GEN: TEXT CYPHER FAIL.\n");
1507
                                                        }
1508
 
1509
                                                        if(memcmp(OUTPUT_KEYR,KEY_FIPS_CTR_DERIVATED,16) == 0)
1510
                                                        {
1511
                                                                printf("CTR KEY GEN: KEYR WHEN CR ENABLE PASSED.\n");
1512
                                                        }else
1513
                                                        {
1514
                                                                printf("CTR KEY GEN: KEYR WHEN CR ENABLE FAIL.\n");
1515
                                                        }
1516
 
1517
 
1518
                                                        if(memcmp(OUTPUT_IVR,IV_FIPS_CTR_NOT_DERIVATED,16) == 0)
1519
                                                        {
1520
                                                                printf("CTR KEY GEN: IVR WHEN CR ENABLE PASSED.\n");
1521
                                                        }else
1522
                                                        {
1523
                                                                printf("CTR KEY GEN: IVR WHEN CR ENABLE FAIL.\n");
1524
                                                        }
1525
 
1526
 
1527
                                                }else if(I == 6217) // CTR KEY GENERATION DMA
1528
                                                {
1529
 
1530
 
1531
                                                        if(memcmp(OUTPUT_TEXT,TEXT_NULL,16) == 0)
1532
                                                        {
1533
                                                                printf("CTR KEY GEN DMA: TEXT CYPHER PASSED.\n");
1534
 
1535
                                                        }else
1536
                                                        {
1537
                                                                printf("CTR KEY GEN DMA: TEXT CYPHER FAIL.\n");
1538
                                                        }
1539
 
1540
                                                        if(memcmp(OUTPUT_KEYR,KEY_FIPS_CTR_DERIVATED,16) == 0)
1541
                                                        {
1542
                                                                printf("CTR KEY GEN DMA: KEYR WHEN CR ENABLE PASSED.\n");
1543
                                                        }else
1544
                                                        {
1545
                                                                printf("CTR KEY GEN DMA: KEYR WHEN CR ENABLE FAIL.\n");
1546
                                                        }
1547
 
1548
 
1549
                                                        if(memcmp(OUTPUT_IVR,IV_FIPS_CTR_NOT_DERIVATED,16) == 0)
1550
                                                        {
1551
                                                                printf("CTR KEY GEN DMA: IVR WHEN CR ENABLE PASSED.\n");
1552
                                                        }else
1553
                                                        {
1554
                                                                printf("CTR KEY GEN DMA: IVR WHEN CR ENABLE FAIL.\n");
1555
                                                        }
1556
 
1557
                                                }else if(I == 585) // CTR KEY GENERATION CCFIE
1558
                                                {
1559
 
1560
                                                        if(memcmp(OUTPUT_TEXT,TEXT_NULL,16) == 0)
1561
                                                        {
1562
                                                                printf("CTR KEY GEN CCFIE: TEXT CYPHER PASSED.\n");
1563
 
1564
                                                        }else
1565
                                                        {
1566
                                                                printf("CTR KEY GEN CCFIE: TEXT CYPHER FAIL.\n");
1567
                                                        }
1568
 
1569
                                                        if(memcmp(OUTPUT_KEYR,KEY_FIPS_CTR_DERIVATED,16) == 0)
1570
                                                        {
1571
                                                                printf("CTR KEY GEN CCFIE: KEYR WHEN CR ENABLE PASSED.\n");
1572
                                                        }else
1573
                                                        {
1574
                                                                printf("CTR KEY GEN CCFIE: KEYR WHEN CR ENABLE FAIL.\n");
1575
                                                        }
1576
 
1577
 
1578
                                                        if(memcmp(OUTPUT_IVR,IV_FIPS_CTR_NOT_DERIVATED,16) == 0)
1579
                                                        {
1580
                                                                printf("CTR KEY GEN CCFIE: IVR WHEN CR ENABLE PASSED.\n");
1581
                                                        }else
1582
                                                        {
1583
                                                                printf("CTR KEY GEN CCFIE: IVR WHEN CR ENABLE FAIL.\n");
1584
                                                        }
1585
 
1586
                                                }
1587
 
1588
 
1589
 
1590
 
1591
 
1592
                                        }//counter == 12
1593
 
1594
                                }
1595
 
1596
 
1597
 
1598
 
1599
                }
1600
 
1601
 
1602
 
1603
 
1604
 
1605 4 redbear
        }
1606
 
1607
        return 0;
1608
}

powered by: WebSVN 2.1.0

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