Line 171... |
Line 171... |
if(FIPS_ENABLE == FIPS)
|
if(FIPS_ENABLE == FIPS)
|
{
|
{
|
|
|
if(vector_address[counter_write] == ADDR_AES_KEYR3)
|
if(vector_address[counter_write] == ADDR_AES_KEYR3)
|
{
|
{
|
a = a | KEY_FIPS_CBC_NOT_DERIVATED[0];
|
a = a | KEY_FIPS_CBC_DERIVATED[0];
|
a = a << 8;
|
a = a << 8;
|
a = a | KEY_FIPS_CBC_NOT_DERIVATED[1];
|
a = a | KEY_FIPS_CBC_DERIVATED[1];
|
a = a << 8;
|
a = a << 8;
|
a = a | KEY_FIPS_CBC_NOT_DERIVATED[2];
|
a = a | KEY_FIPS_CBC_DERIVATED[2];
|
a = a << 8;
|
a = a << 8;
|
a = a | KEY_FIPS_CBC_NOT_DERIVATED[3];
|
a = a | KEY_FIPS_CBC_DERIVATED[3];
|
v_ecb.value.integer = a;
|
v_ecb.value.integer = a;
|
}
|
}
|
|
|
|
|
if(vector_address[counter_write] == ADDR_AES_KEYR2)
|
if(vector_address[counter_write] == ADDR_AES_KEYR2)
|
{
|
{
|
b = b | KEY_FIPS_CBC_NOT_DERIVATED[4];
|
b = b | KEY_FIPS_CBC_DERIVATED[4];
|
b = b << 8;
|
b = b << 8;
|
b = b | KEY_FIPS_CBC_NOT_DERIVATED[5];
|
b = b | KEY_FIPS_CBC_DERIVATED[5];
|
b = b << 8;
|
b = b << 8;
|
b = b | KEY_FIPS_CBC_NOT_DERIVATED[6];
|
b = b | KEY_FIPS_CBC_DERIVATED[6];
|
b = b << 8;
|
b = b << 8;
|
b = b | KEY_FIPS_CBC_NOT_DERIVATED[7];
|
b = b | KEY_FIPS_CBC_DERIVATED[7];
|
v_ecb.value.integer = b;
|
v_ecb.value.integer = b;
|
}
|
}
|
|
|
if(vector_address[counter_write] == ADDR_AES_KEYR1)
|
if(vector_address[counter_write] == ADDR_AES_KEYR1)
|
{
|
{
|
|
|
c = c | KEY_FIPS_CBC_NOT_DERIVATED[8];
|
c = c | KEY_FIPS_CBC_DERIVATED[8];
|
c = c << 8;
|
c = c << 8;
|
c = c | KEY_FIPS_CBC_NOT_DERIVATED[9];
|
c = c | KEY_FIPS_CBC_DERIVATED[9];
|
c = c << 8;
|
c = c << 8;
|
c = c | KEY_FIPS_CBC_NOT_DERIVATED[10];
|
c = c | KEY_FIPS_CBC_DERIVATED[10];
|
c = c << 8;
|
c = c << 8;
|
c = c | KEY_FIPS_CBC_NOT_DERIVATED[11];
|
c = c | KEY_FIPS_CBC_DERIVATED[11];
|
v_ecb.value.integer = c;
|
v_ecb.value.integer = c;
|
|
|
}
|
}
|
|
|
if(vector_address[counter_write] == ADDR_AES_KEYR0)
|
if(vector_address[counter_write] == ADDR_AES_KEYR0)
|
{
|
{
|
d = d | KEY_FIPS_CBC_NOT_DERIVATED[12];
|
d = d | KEY_FIPS_CBC_DERIVATED[12];
|
d = d << 8;
|
d = d << 8;
|
d = d | KEY_FIPS_CBC_NOT_DERIVATED[13];
|
d = d | KEY_FIPS_CBC_DERIVATED[13];
|
d = d << 8;
|
d = d << 8;
|
d = d | KEY_FIPS_CBC_NOT_DERIVATED[14];
|
d = d | KEY_FIPS_CBC_DERIVATED[14];
|
d = d << 8;
|
d = d << 8;
|
d = d | KEY_FIPS_CBC_NOT_DERIVATED[15];
|
d = d | KEY_FIPS_CBC_DERIVATED[15];
|
v_ecb.value.integer = d;
|
v_ecb.value.integer = d;
|
}
|
}
|
|
|
|
|
if(vector_address[counter_write] == ADDR_AES_IVR3)
|
if(vector_address[counter_write] == ADDR_AES_IVR3)
|
Line 407... |
Line 407... |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
|
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
|
|
|
v_ecb.value.integer = 0;
|
v_ecb.value.integer = 0;
|
vpi_put_value(PWRITE, &v_ecb, NULL, vpiNoDelay);
|
vpi_put_value(PWRITE, &v_ecb, NULL, vpiNoDelay);
|
|
|
if(counter == 0)
|
v_ecb.value.integer = 0;
|
{
|
vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
|
|
|
counter++;
|
/*
|
|
if(counter == 0)
|
|
{
|
|
|
v_ecb.value.integer = 1;
|
counter++;
|
vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
|
|
|
|
|
v_ecb.value.integer = 1;
|
|
vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
|
|
|
}else if(counter == 1)
|
|
{
|
|
v_ecb.value.integer = 0;
|
|
vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
|
|
|
|
counter=0;
|
}else if(counter == 1)
|
}
|
{
|
|
v_ecb.value.integer = 0;
|
|
vpi_put_value(PENABLE, &v_ecb, NULL, vpiNoDelay);
|
|
|
|
counter=0;
|
|
}
|
|
*/
|
v_ecb.value.integer = 0;
|
v_ecb.value.integer = 0;
|
vpi_get_value(PRDATA,&v_ecb);
|
vpi_get_value(int_ccf,&v_ecb);
|
|
|
if(v_ecb.value.integer == 1)
|
if(v_ecb.value.integer == 1)
|
{
|
{
|
STATE = READ_DOUTR;
|
STATE = READ_DOUTR;
|
|
|
t_ecb.type = vpiScaledRealTime;
|
//t_ecb.type = vpiScaledRealTime;
|
t_ecb.real = 0;
|
//t_ecb.real = 0;
|
v_ecb.format=vpiIntVal;
|
//v_ecb.format=vpiIntVal;
|
v_ecb.value.integer = ADDR_AES_DOUTR;
|
//v_ecb.value.integer = ADDR_AES_DOUTR;
|
vpi_put_value(PADDR, &v_ecb, &t_ecb, vpiTransportDelay);
|
//vpi_put_value(PADDR, &v_ecb, &t_ecb, vpiTransportDelay);
|
}
|
}
|
|
|
|
|
break;
|
break;
|
|
|