Line 75... |
Line 75... |
|
|
#include "../../iverilog/vpi_user.h"
|
#include "../../iverilog/vpi_user.h"
|
//#include <vpi_user.h>
|
//#include <vpi_user.h>
|
#include <iostream>
|
#include <iostream>
|
#include <random>
|
#include <random>
|
|
#include<string.h>
|
|
|
|
|
s_vpi_value v_generate;
|
s_vpi_value v_generate;
|
|
|
s_vpi_value v_ecb;
|
s_vpi_value v_ecb;
|
s_vpi_time t_ecb;
|
s_vpi_time t_ecb;
|
|
|
|
s_vpi_value v_monitor;
|
|
s_vpi_value v_monitor_catch;
|
|
|
|
s_vpi_time t_monitor;
|
|
|
s_vpi_value v_wr;
|
s_vpi_value v_wr;
|
s_vpi_time t_wr;
|
s_vpi_time t_wr;
|
|
|
s_vpi_value v_reset;
|
s_vpi_value v_reset;
|
s_vpi_time t_reset;
|
s_vpi_time t_reset;
|
|
|
|
|
s_vpi_value v_initial;
|
s_vpi_value v_initial;
|
s_vpi_time t_initial;
|
s_vpi_time t_initial;
|
|
|
|
//USED BY BFM ONLY
|
unsigned long int a;
|
unsigned long int a;
|
unsigned long int b;
|
unsigned long int b;
|
unsigned long int c;
|
unsigned long int c;
|
unsigned long int d;
|
unsigned long int d;
|
|
|
|
|
|
//USED BY MONITOR ONLY
|
|
unsigned long int A;
|
|
unsigned long int B;
|
|
unsigned long int C;
|
|
unsigned long int D;
|
|
|
|
|
|
unsigned long int E;
|
|
unsigned long int F;
|
|
unsigned long int G;
|
|
unsigned long int H;
|
|
|
|
unsigned long int I;
|
|
|
|
unsigned long int J;
|
|
unsigned long int L;
|
|
unsigned long int M;
|
|
unsigned long int N;
|
|
|
int type_bfm;
|
int type_bfm;
|
|
|
int STATE;
|
int STATE;
|
int STATE_RESET;
|
int STATE_RESET;
|
|
|
int counter;
|
int counter;
|
|
int counter_monitor;
|
|
int cycle_counter;
|
|
|
|
|
int flag;
|
int flag;
|
|
|
int reset_counter;
|
int reset_counter;
|
int counter_reset_enter;
|
int counter_reset_enter;
|
Line 215... |
Line 244... |
#define FIPS 0
|
#define FIPS 0
|
#define RANDOM_DATA 1
|
#define RANDOM_DATA 1
|
|
|
|
|
/*MAX PACKETS GENERATION*/
|
/*MAX PACKETS GENERATION*/
|
#define MAX_ITERATIONS 17
|
#define MAX_ITERATIONS 5
|
|
|
/*MAX RESET GENERATION */
|
/*MAX RESET GENERATION */
|
#define MAX_RESET_TIMES 4
|
#define MAX_RESET_TIMES 4
|
|
|
|
/*THIS IS USED BY MONITOR TO CATCH INPUTS AND OUTPUTS*/
|
|
unsigned char INPUT_KEYR[16];
|
|
unsigned char OUTPUT_KEYR[16];
|
|
|
|
unsigned char INPUT_IVR[16];
|
|
unsigned char OUTPUT_IVR[16];
|
|
|
|
unsigned char INPUT_TEXT[16];
|
|
unsigned char OUTPUT_TEXT[16];
|
|
|
|
|
/*THIS INCLUDE IS USED TO GENERATE DATA DO BE INSERTED ON DUT*/
|
/*THIS INCLUDE IS USED TO GENERATE DATA DO BE INSERTED ON DUT*/
|
unsigned char TEXT_FIPS_NOT_DERIVATED[] = {0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE,0xFF};
|
unsigned char TEXT_FIPS_NOT_DERIVATED[] = {0x00,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99,0xAA,0xBB,0xCC,0xDD,0xEE,0xFF};
|
unsigned char KEY_FIPS_NOT_DERIVATED[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F};
|
unsigned char KEY_FIPS_NOT_DERIVATED[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F};
|
|
|
unsigned char TEXT_FIPS_DERIVATED[] = {0x69,0xC4,0xE0,0xD8,0x6A,0x7B,0x04,0x30,0xD8,0xCD,0xB7,0x80,0x70,0xB4,0xC5,0x5A};
|
unsigned char TEXT_FIPS_DERIVATED[] = {0x69,0xC4,0xE0,0xD8,0x6A,0x7B,0x04,0x30,0xD8,0xCD,0xB7,0x80,0x70,0xB4,0xC5,0x5A};
|
unsigned char KEY_FIPS_DERIVATED[] = {0x13,0x11,0x1D,0x7F,0xE3,0x94,0x4A,0x17,0xF3,0x07,0xA7,0x8B,0x4D,0x2B,0x30,0xC5};
|
unsigned char KEY_FIPS_DERIVATED[] = {0x13,0x11,0x1D,0x7F,0xE3,0x94,0x4A,0x17,0xF3,0x07,0xA7,0x8B,0x4D,0x2B,0x30,0xC5};
|
|
|
|
|
unsigned char KEY_FIPS_CBC_NOT_DERIVATED[] = {0x2B,0x7E,0x15,0x16,0x28,0xAE,0xD2,0xA6,0xAB,0xF7,0x15,0x88,0x09,0xCF,0x4F,0x3C};
|
unsigned char KEY_FIPS_CBC_NOT_DERIVATED[] = {0x2B,0x7E,0x15,0x16,0x28,0xAE,0xD2,0xA6,0xAB,0xF7,0x15,0x88,0x09,0xCF,0x4F,0x3C};
|
unsigned char IV_FIPS_CBC_NOT_DERIVATED[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F};
|
unsigned char IV_FIPS_CBC_NOT_DERIVATED[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F};
|
|
|
|
|
unsigned char TEXT_FIPS_CBC_NOT_DERIVATED[] = {0x6B,0xC1,0xBE,0xE2,0x2E,0x40,0x9F,0x96,0xE9,0x3D,0x7E,0x11,0x73,0x93,0x17,0x2A};
|
unsigned char TEXT_FIPS_CBC_NOT_DERIVATED[] = {0x6B,0xC1,0xBE,0xE2,0x2E,0x40,0x9F,0x96,0xE9,0x3D,0x7E,0x11,0x73,0x93,0x17,0x2A};
|
|
unsigned char KEY_FIPS_CBC_DERIVATED[] = {0xD0,0x14,0xF9,0xA8,0xC9,0xEE,0x25,0x89,0xE1,0x3F,0x0C,0xC8,0xB6,0x63,0x0C,0xA6};
|
|
|
|
|
unsigned char TEXT_CBC_FIPS_DERIVATED[] = {0x76,0x49,0xAB,0xAC,0x81,0x19,0xB2,0x46,0xCE,0xE9,0x8E,0x9B,0x12,0xE9,0x19,0x7D};
|
unsigned char TEXT_CBC_FIPS_DERIVATED[] = {0x76,0x49,0xAB,0xAC,0x81,0x19,0xB2,0x46,0xCE,0xE9,0x8E,0x9B,0x12,0xE9,0x19,0x7D};
|
|
|
|
|
unsigned char KEY_FIPS_CTR_NOT_DERIVATED[] = {0x2B,0x7E,0x15,0x16,0x28,0xAE,0xD2,0xA6,0xAB,0xF7,0x15,0x88,0x09,0xCF,0x4F,0x3C};
|
unsigned char KEY_FIPS_CTR_NOT_DERIVATED[] = {0x2B,0x7E,0x15,0x16,0x28,0xAE,0xD2,0xA6,0xAB,0xF7,0x15,0x88,0x09,0xCF,0x4F,0x3C};
|
unsigned char IV_FIPS_CTR_NOT_DERIVATED[] = {0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
|
unsigned char IV_FIPS_CTR_NOT_DERIVATED[] = {0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
|
unsigned char TEXT_FIPS_CTR_NOT_DERIVATED[] = {0x6B,0xC1,0xBE,0xE2,0x2E,0x40,0x9F,0x96,0xE9,0x3D,0x7E,0x11,0x73,0x93,0x17,0x2A};
|
unsigned char TEXT_FIPS_CTR_NOT_DERIVATED[] = {0x6B,0xC1,0xBE,0xE2,0x2E,0x40,0x9F,0x96,0xE9,0x3D,0x7E,0x11,0x73,0x93,0x17,0x2A};
|
|
|
unsigned char TEXT_CTR_FIPS_DERIVATED[] = {0x87,0x4D,0x61,0x91,0xB6,0x20,0xE3,0x26,0x1B,0xEF,0x68,0x64,0x99,0x0D,0xB6,0xCE};
|
unsigned char TEXT_CTR_FIPS_DERIVATED[] = {0x87,0x4D,0x61,0x91,0xB6,0x20,0xE3,0x26,0x1B,0xEF,0x68,0x64,0x99,0x0D,0xB6,0xCE};
|
|
unsigned char KEY_FIPS_CTR_DERIVATED[] = {0xD0,0x14,0xF9,0xA8,0xC9,0xEE,0x25,0x89,0xE1,0x3F,0x0C,0xC8,0xB6,0x63,0x0C,0xA6};
|
|
|
|
unsigned char TEXT_NULL[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
|
|
/*BFM CONTROL FLOW*/
|
/*BFM CONTROL FLOW*/
|
#include "aes_bfm_generate.h"
|
#include "aes_bfm_generate.h"
|
|
|
/*BASIC TEST WRITE READ*/
|
/*BASIC TEST WRITE READ*/
|