URL
https://opencores.org/ocsvn/apbtoaes128/apbtoaes128/trunk
Subversion Repositories apbtoaes128
Compare Revisions
- This comparison shows the changes necessary to convert path
/apbtoaes128/trunk/pli
- from Rev 9 to Rev 12
- ↔ Reverse comparison
Rev 9 → Rev 12
/aes_init.h
92,14 → 92,12
|
|
|
//type_bfm = AES_WR_ONLY; |
|
|
STATE = IDLE; |
|
|
counter_write = 0; |
counter_read = 0; |
counter_wait = 0; |
PACKETS_GENERATED = 0; |
counter = 0; |
reset_counter = 0; |
112,7 → 110,7
|
v_monitor.value.integer=0; |
v_monitor_catch.value.integer=0; |
A=B=C=D=E=F=G=H=I=J=L=M=N=0; |
A=B=C=D=E=F=G=H=I=J=L=M=N=O=0; |
|
for(counter_monitor=0;counter_monitor < 16;counter_monitor++) |
{ |
129,22 → 127,322
counter_monitor=0; |
cycle_counter =0; |
|
/* WRITE READ |
vector_address[0]= ADDR_AES_CR; |
vector_address[1]= ADDR_AES_SR; |
vector_address[2]= ADDR_AES_DINR; |
vector_address[3]= ADDR_AES_DOUTR; |
vector_address[4]= ADDR_AES_KEYR3; |
vector_address[5]= ADDR_AES_KEYR2; |
vector_address[6]= ADDR_AES_KEYR1; |
vector_address[7]= ADDR_AES_KEYR0; |
vector_address[8]= ADDR_AES_IVR3; |
vector_address[9]= ADDR_AES_IVR2; |
vector_address[10]=ADDR_AES_IVR1; |
vector_address[11]=ADDR_AES_IVR0; |
|
/* |
ECB ERROR TEST CASES DEFINITIONS |
*/ |
|
vector_CR[0]= 1; // ECB ENCRYPTION REGISTER ERROR DATATYPE 0 |
vector_CR[1]= 3; // ECB ENCRYPTION REGISTER ERROR DATATYPE 1 |
vector_CR[2]= 5; // ECB ENCRYPTION REGISTER ERROR DATATYPE 2 |
vector_CR[3]= 7; // ECB ENCRYPTION REGISTER ERROR DATATYPE 3 |
|
vector_CR[4]= 1025; // ECB ENCRYPTION INT_ERR DATATYPE 0 |
vector_CR[5]= 1027; // ECB ENCRYPTION INT_ERR DATATYPE 1 |
vector_CR[6]= 1029; // ECB ENCRYPTION INT_ERR DATATYPE 2 |
vector_CR[7]= 1031; // ECB ENCRYPTION INT_ERR DATATYPE 3 |
|
vector_CR[8] = 6145; // ECB ENCRYPTION DMA REGISTER ERROR DATATYPE 0 |
vector_CR[9] = 6147; // ECB ENCRYPTION DMA REGISTER ERROR DATATYPE 1 |
vector_CR[10]= 6149; // ECB ENCRYPTION DMA REGISTER ERROR DATATYPE 2 |
vector_CR[11]= 6151; // ECB ENCRYPTION DMA REGISTER ERROR DATATYPE 3 |
|
vector_CR[12]= 7169; // ECB ENCRYPTION DMA INT_ERR DATATYPE 0 |
vector_CR[13]= 7171; // ECB ENCRYPTION DMA INT_ERR DATATYPE 1 |
vector_CR[14]= 7173; // ECB ENCRYPTION DMA INT_ERR DATATYPE 2 |
vector_CR[15]= 7175; // ECB ENCRYPTION DMA INT_ERR DATATYPE 3 |
|
vector_CR[16]= 513; // ECB ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 0 |
vector_CR[17]= 515; // ECB ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 1 |
vector_CR[18]= 517; // ECB ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 2 |
vector_CR[19]= 519; // ECB ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 3 |
|
vector_CR[20]= 1537; // ECB ENCRYPTION INT_CCF INT_ERR DATATYPE 0 |
vector_CR[21]= 1539; // ECB ENCRYPTION INT_CCF INT_ERR DATATYPE 1 |
vector_CR[22]= 1541; // ECB ENCRYPTION INT_CCF INT_ERR DATATYPE 2 |
vector_CR[23]= 1543; // ECB ENCRYPTION INT_CCF INT_ERR DATATYPE 3 |
|
vector_CR[24]= 17; // ECB DECRYPTION REGISTER ERROR DATATYPE 0 |
vector_CR[25]= 19; // ECB DECRYPTION REGISTER ERROR DATATYPE 1 |
vector_CR[26]= 21; // ECB DECRYPTION REGISTER ERROR DATATYPE 2 |
vector_CR[27]= 23; // ECB DECRYPTION REGISTER ERROR DATATYPE 3 |
|
vector_CR[28]= 1041; // ECB DECRYPTION INT_ERR DATATYPE 0 |
vector_CR[29]= 1043; // ECB DECRYPTION INT_ERR DATATYPE 1 |
vector_CR[30]= 1045; // ECB DECRYPTION INT_ERR DATATYPE 2 |
vector_CR[31]= 1047; // ECB DECRYPTION INT_ERR DATATYPE 3 |
|
vector_CR[32]= 6161; // ECB DECRYPTION DMA REGISTER ERROR DATATYPE 0 |
vector_CR[33]= 6163; // ECB DECRYPTION DMA REGISTER ERROR DATATYPE 1 |
vector_CR[34]= 6165; // ECB DECRYPTION DMA REGISTER ERROR DATATYPE 2 |
vector_CR[35]= 6167; // ECB DECRYPTION DMA REGISTER ERROR DATATYPE 3 |
|
vector_CR[36]= 7185; // ECB DECRYPTION DMA INT_ERR DATATYPE 0 |
vector_CR[37]= 7187; // ECB DECRYPTION DMA INT_ERR DATATYPE 1 |
vector_CR[38]= 7189; // ECB DECRYPTION DMA INT_ERR DATATYPE 2 |
vector_CR[39]= 7191; // ECB DECRYPTION DMA INT_ERR DATATYPE 3 |
|
vector_CR[40]= 529; // ECB DECRYPTION INT CCF REGISTER ERROR DATATYPE 0 |
vector_CR[41]= 531; // ECB DECRYPTION INT CCF REGISTER ERROR DATATYPE 1 |
vector_CR[42]= 533; // ECB DECRYPTION INT CCF REGISTER ERROR DATATYPE 2 |
vector_CR[43]= 535; // ECB DECRYPTION INT CCF REGISTER ERROR DATATYPE 3 |
|
vector_CR[44]= 1553; // ECB DECRYPTION INT CCF INT_ERR DATATYPE 0 |
vector_CR[45]= 1555; // ECB DECRYPTION INT CCF INT_ERR DATATYPE 1 |
vector_CR[46]= 1557; // ECB DECRYPTION INT CCF INT_ERR DATATYPE 2 |
vector_CR[47]= 1559; // ECB DECRYPTION INT CCF INT_ERR DATATYPE 3 |
|
vector_CR[48]= 25; // ECB DECRYPTION DERIVATION REGISTER ERROR DATATYPE 0 |
vector_CR[49]= 27; // ECB DECRYPTION DERIVATION REGISTER ERROR DATATYPE 1 |
vector_CR[50]= 29; // ECB DECRYPTION DERIVATION REGISTER ERROR DATATYPE 2 |
vector_CR[51]= 31; // ECB DECRYPTION DERIVATION REGISTER ERROR DATATYPE 3 |
|
vector_CR[52]= 1049; // ECB DECRYPTION DERIVATION INT_ERR DATATYPE 0 |
vector_CR[53]= 1051; // ECB DECRYPTION DERIVATION INT_ERR DATATYPE 1 |
vector_CR[54]= 1053; // ECB DECRYPTION DERIVATION INT_ERR DATATYPE 2 |
vector_CR[55]= 1055; // ECB DECRYPTION DERIVATION INT_ERR DATATYPE 3 |
|
vector_CR[56]= 6169; // ECB DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 0 |
vector_CR[57]= 6171; // ECB DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 1 |
vector_CR[58]= 6173; // ECB DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 2 |
vector_CR[59]= 6175; // ECB DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 3 |
|
vector_CR[60]= 7193; // ECB DECRYPTION DERIVATION DMA INT_ERR DATATYPE 0 |
vector_CR[61]= 7195; // ECB DECRYPTION DERIVATION DMA INT_ERR DATATYPE 1 |
vector_CR[62]= 7197; // ECB DECRYPTION DERIVATION DMA INT_ERR DATATYPE 2 |
vector_CR[63]= 7199; // ECB DECRYPTION DERIVATION DMA INT_ERR DATATYPE 3 |
|
vector_CR[64]= 537; // ECB DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 0 |
vector_CR[65]= 539; // ECB DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 1 |
vector_CR[66]= 541; // ECB DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 2 |
vector_CR[67]= 543; // ECB DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 3 |
|
vector_CR[68]= 1561; // ECB DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 0 |
vector_CR[69]= 1563; // ECB DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 1 |
vector_CR[70]= 1565; // ECB DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 2 |
vector_CR[71]= 1567; // ECB DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 3 |
|
vector_CR[72]= 9; // ECB KEY GENERATION REGISTER ERROR |
vector_CR[73]= 1033; // ECB KEY GENERATION INT_ERR |
|
vector_CR[74]= 6153; // ECB KEY GENERATION DMA REGISTER ERROR |
vector_CR[75]= 7177; // ECB KEY GENERATION DMA INT_ERR |
|
vector_CR[76]= 521; // ECB DECRYPTION DERIVATION INT CCF REGISTER ERROR |
vector_CR[77]= 1545; // ECB DECRYPTION DERIVATION INT CCF INT_ERR |
|
|
/* |
CBC ERROR TEST CASES DEFINITIONS |
*/ |
|
vector_CR[78]= 33; // CBC ENCRYPTION REGISTER ERROR DATATYPE 0 |
vector_CR[79]= 35; // CBC ENCRYPTION REGISTER ERROR DATATYPE 1 |
vector_CR[80]= 37; // CBC ENCRYPTION REGISTER ERROR DATATYPE 2 |
vector_CR[81]= 39; // CBC ENCRYPTION REGISTER ERROR DATATYPE 3 |
|
vector_CR[82]= 1057; // CBC ENCRYPTION INT_ERR DATATYPE 0 |
vector_CR[83]= 1059; // CBC ENCRYPTION INT_ERR DATATYPE 1 |
vector_CR[84]= 1061; // CBC ENCRYPTION INT_ERR DATATYPE 2 |
vector_CR[85]= 1063; // CBC ENCRYPTION INT_ERR DATATYPE 3 |
|
vector_CR[86]= 6177; // CBC ENCRYPTION DMA REGISTER ERROR DATATYPE 0 |
vector_CR[87]= 6179; // CBC ENCRYPTION DMA REGISTER ERROR DATATYPE 1 |
vector_CR[88]= 6181; // CBC ENCRYPTION DMA REGISTER ERROR DATATYPE 2 |
vector_CR[89]= 6183; // CBC ENCRYPTION DMA REGISTER ERROR DATATYPE 3 |
|
vector_CR[90]= 7201; // CBC ENCRYPTION DMA INT_ERR DATATYPE 0 |
vector_CR[91]= 7203; // CBC ENCRYPTION DMA INT_ERR DATATYPE 1 |
vector_CR[92]= 7205; // CBC ENCRYPTION DMA INT_ERR DATATYPE 2 |
vector_CR[92]= 7207; // CBC ENCRYPTION DMA INT_ERR DATATYPE 3 |
|
vector_CR[93]= 545; // CBC ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 0 |
vector_CR[94]= 547; // CBC ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 1 |
vector_CR[95]= 549; // CBC ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 2 |
vector_CR[96]= 551; // CBC ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 3 |
|
vector_CR[97]= 1569; // CBC ENCRYPTION INT_CCF INT_ERR DATATYPE 0 |
vector_CR[98]= 1571; // CBC ENCRYPTION INT_CCF INT_ERR DATATYPE 1 |
vector_CR[99]= 1573; // CBC ENCRYPTION INT_CCF INT_ERR DATATYPE 2 |
vector_CR[100]= 1575; // CBC ENCRYPTION INT_CCF INT_ERR DATATYPE 3 |
|
vector_CR[101]= 49; // CBC DECRYPTION REGISTER ERROR DATATYPE 0 |
vector_CR[102]= 51; // CBC DECRYPTION REGISTER ERROR DATATYPE 1 |
vector_CR[103]= 53; // CBC DECRYPTION REGISTER ERROR DATATYPE 2 |
vector_CR[104]= 55; // CBC DECRYPTION REGISTER ERROR DATATYPE 3 |
|
vector_CR[105]= 1073; // CBC DECRYPTION INT_ERR DATATYPE 0 |
vector_CR[106]= 1075; // CBC DECRYPTION INT_ERR DATATYPE 1 |
vector_CR[107]= 1077; // CBC DECRYPTION INT_ERR DATATYPE 2 |
vector_CR[108]= 1079; // CBC DECRYPTION INT_ERR DATATYPE 3 |
|
vector_CR[109]= 6193; // CBC DECRYPTION DMA REGISTER ERROR DATATYPE 0 |
vector_CR[110]= 6195; // CBC DECRYPTION DMA REGISTER ERROR DATATYPE 1 |
vector_CR[111]= 6197; // CBC DECRYPTION DMA REGISTER ERROR DATATYPE 2 |
vector_CR[112]= 6199; // CBC DECRYPTION DMA REGISTER ERROR DATATYPE 3 |
|
vector_CR[113]= 7217; // CBC DECRYPTION DMA INT_ERR DATATYPE 0 |
vector_CR[114]= 7219; // CBC DECRYPTION DMA INT_ERR DATATYPE 1 |
vector_CR[115]= 7221; // CBC DECRYPTION DMA INT_ERR DATATYPE 2 |
vector_CR[116]= 7223; // CBC DECRYPTION DMA INT_ERR DATATYPE 3 |
|
vector_CR[117]= 561; // CBC DECRYPTION INT CCF REGISTER ERROR DATATYPE 0 |
vector_CR[118]= 563; // CBC DECRYPTION INT CCF REGISTER ERROR DATATYPE 1 |
vector_CR[119]= 565; // CBC DECRYPTION INT CCF REGISTER ERROR DATATYPE 2 |
vector_CR[120]= 567; // CBC DECRYPTION INT CCF REGISTER ERROR DATATYPE 3 |
|
vector_CR[121]= 1585; // CBC DECRYPTION INT CCF INT_ERR DATATYPE 0 |
vector_CR[122]= 1587; // CBC DECRYPTION INT CCF INT_ERR DATATYPE 1 |
vector_CR[123]= 1589; // CBC DECRYPTION INT CCF INT_ERR DATATYPE 2 |
vector_CR[124]= 1591; // CBC DECRYPTION INT CCF INT_ERR DATATYPE 3 |
|
vector_CR[125]= 57; // CBC DECRYPTION DERIVATION REGISTER ERROR DATATYPE 0 |
vector_CR[126]= 59; // CBC DECRYPTION DERIVATION REGISTER ERROR DATATYPE 1 |
vector_CR[127]= 61; // CBC DECRYPTION DERIVATION REGISTER ERROR DATATYPE 2 |
vector_CR[128]= 63; // CBC DECRYPTION DERIVATION REGISTER ERROR DATATYPE 3 |
|
vector_CR[129]= 1081; // CBC DECRYPTION DERIVATION INT_ERR DATATYPE 0 |
vector_CR[130]= 1083; // CBC DECRYPTION DERIVATION INT_ERR DATATYPE 1 |
vector_CR[131]= 1085; // CBC DECRYPTION DERIVATION INT_ERR DATATYPE 2 |
vector_CR[132]= 1087; // CBC DECRYPTION DERIVATION INT_ERR DATATYPE 3 |
|
vector_CR[133]= 6201; // CBC DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 0 |
vector_CR[134]= 6203; // CBC DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 1 |
vector_CR[135]= 6205; // CBC DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 2 |
vector_CR[136]= 6207; // CBC DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 3 |
|
vector_CR[137]= 7225; // CBC DECRYPTION DERIVATION DMA INT_ERR DATATYPE 0 |
vector_CR[138]= 7227; // CBC DECRYPTION DERIVATION DMA INT_ERR DATATYPE 1 |
vector_CR[139]= 7229; // CBC DECRYPTION DERIVATION DMA INT_ERR DATATYPE 2 |
vector_CR[140]= 7231; // CBC DECRYPTION DERIVATION DMA INT_ERR DATATYPE 3 |
|
vector_CR[141]= 569; // CBC DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 0 |
vector_CR[142]= 571; // CBC DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 1 |
vector_CR[143]= 573; // CBC DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 2 |
vector_CR[144]= 575; // CBC DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 3 |
|
vector_CR[145]= 1593; // CBC DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 0 |
vector_CR[146]= 1595; // CBC DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 1 |
vector_CR[147]= 1597; // CBC DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 2 |
vector_CR[148]= 1599; // CBC DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 3 |
|
vector_CR[149]= 41; // CBC KEY GENERATION REGISTER ERROR |
vector_CR[150]= 1065; // CBC KEY GENERATION INT_ERR |
|
vector_CR[151]= 6185; // CBC KEY GENERATION DMA REGISTER ERROR |
vector_CR[152]= 7209; // CBC KEY GENERATION DMA INT_ERR |
|
vector_CR[153]= 553; // CBC DECRYPTION DERIVATION INT CCF REGISTER ERROR |
vector_CR[154]= 1577; // CBC DECRYPTION DERIVATION INT CCF INT_ERR |
|
|
/* |
CTR ERROR TEST CASES DEFINITIONS |
*/ |
|
vector_CR[155]= 65; // CTR ENCRYPTION REGISTER ERROR DATATYPE 0 |
vector_CR[156]= 67; // CTR ENCRYPTION REGISTER ERROR DATATYPE 1 |
vector_CR[157]= 69; // CTR ENCRYPTION REGISTER ERROR DATATYPE 2 |
vector_CR[158]= 71; // CTR ENCRYPTION REGISTER ERROR DATATYPE 3 |
|
vector_CR[159]= 1089; // CTR ENCRYPTION INT_ERR DATATYPE 0 |
vector_CR[160]= 1091; // CTR ENCRYPTION INT_ERR DATATYPE 1 |
vector_CR[161]= 1093; // CTR ENCRYPTION INT_ERR DATATYPE 2 |
vector_CR[162]= 1095; // CTR ENCRYPTION INT_ERR DATATYPE 3 |
|
vector_CR[163]= 6209; // CTR ENCRYPTION DMA REGISTER ERROR DATATYPE 0 |
vector_CR[164]= 6211; // CTR ENCRYPTION DMA REGISTER ERROR DATATYPE 1 |
vector_CR[165]= 6213; // CTR ENCRYPTION DMA REGISTER ERROR DATATYPE 2 |
vector_CR[166]= 6215; // CTR ENCRYPTION DMA REGISTER ERROR DATATYPE 3 |
|
vector_CR[167]= 7233; // CTR ENCRYPTION DMA INT_ERR DATATYPE 0 |
vector_CR[168]= 7235; // CTR ENCRYPTION DMA INT_ERR DATATYPE 1 |
vector_CR[169]= 7237; // CTR ENCRYPTION DMA INT_ERR DATATYPE 2 |
vector_CR[170]= 7239; // CTR ENCRYPTION DMA INT_ERR DATATYPE 3 |
|
vector_CR[171]= 577; // CTR ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 0 |
vector_CR[172]= 579; // CTR ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 1 |
vector_CR[173]= 581; // CTR ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 2 |
vector_CR[174]= 583; // CTR ENCRYPTION INT_CCF REGISTER ERROR DATATYPE 3 |
|
vector_CR[175]= 1601; // CTR ENCRYPTION INT_CCF INT_ERR DATATYPE 0 |
vector_CR[176]= 1603; // CTR ENCRYPTION INT_CCF INT_ERR DATATYPE 1 |
vector_CR[177]= 1605; // CTR ENCRYPTION INT_CCF INT_ERR DATATYPE 2 |
vector_CR[178]= 1607; // CTR ENCRYPTION INT_CCF INT_ERR DATATYPE 3 |
|
vector_CR[179]= 81; // CTR DECRYPTION REGISTER ERROR DATATYPE 0 |
vector_CR[180]= 83; // CTR DECRYPTION REGISTER ERROR DATATYPE 1 |
vector_CR[181]= 85; // CTR DECRYPTION REGISTER ERROR DATATYPE 2 |
vector_CR[182]= 87; // CTR DECRYPTION REGISTER ERROR DATATYPE 3 |
|
vector_CR[183]= 1105; // CTR DECRYPTION INT_ERR DATATYPE 0 |
vector_CR[184]= 1107; // CTR DECRYPTION INT_ERR DATATYPE 1 |
vector_CR[185]= 1109; // CTR DECRYPTION INT_ERR DATATYPE 2 |
vector_CR[186]= 1111; // CTR DECRYPTION INT_ERR DATATYPE 3 |
|
vector_CR[187]= 6225; // CTR DECRYPTION DMA REGISTER ERROR DATATYPE 0 |
vector_CR[188]= 6227; // CTR DECRYPTION DMA REGISTER ERROR DATATYPE 1 |
vector_CR[189]= 6229; // CTR DECRYPTION DMA REGISTER ERROR DATATYPE 2 |
vector_CR[190]= 6231; // CTR DECRYPTION DMA REGISTER ERROR DATATYPE 3 |
|
vector_CR[191]= 7249; // CTR DECRYPTION DMA INT_ERR DATATYPE 0 |
vector_CR[192]= 7251; // CTR DECRYPTION DMA INT_ERR DATATYPE 1 |
vector_CR[193]= 7253; // CTR DECRYPTION DMA INT_ERR DATATYPE 2 |
vector_CR[194]= 7255; // CTR DECRYPTION DMA INT_ERR DATATYPE 3 |
|
vector_CR[195]= 593; // CTR DECRYPTION INT CCF REGISTER ERROR DATATYPE 0 |
vector_CR[196]= 595; // CTR DECRYPTION INT CCF REGISTER ERROR DATATYPE 1 |
vector_CR[197]= 597; // CTR DECRYPTION INT CCF REGISTER ERROR DATATYPE 2 |
vector_CR[198]= 599; // CTR DECRYPTION INT CCF REGISTER ERROR DATATYPE 3 |
|
vector_CR[199]= 1617; // CTR DECRYPTION INT CCF INT_ERR DATATYPE 0 |
vector_CR[200]= 1619; // CTR DECRYPTION INT CCF INT_ERR DATATYPE 1 |
vector_CR[201]= 1621; // CTR DECRYPTION INT CCF INT_ERR DATATYPE 2 |
vector_CR[202]= 1623; // CTR DECRYPTION INT CCF INT_ERR DATATYPE 3 |
|
vector_CR[203]= 89; // CTR DECRYPTION DERIVATION REGISTER ERROR DATATYPE 0 |
vector_CR[204]= 91; // CTR DECRYPTION DERIVATION REGISTER ERROR DATATYPE 1 |
vector_CR[205]= 93; // CTR DECRYPTION DERIVATION REGISTER ERROR DATATYPE 2 |
vector_CR[206]= 95; // CTR DECRYPTION DERIVATION REGISTER ERROR DATATYPE 3 |
|
vector_CR[207]= 1113; // CTR DECRYPTION DERIVATION INT_ERR DATATYPE 0 |
vector_CR[208]= 1115; // CTR DECRYPTION DERIVATION INT_ERR DATATYPE 1 |
vector_CR[209]= 1117; // CTR DECRYPTION DERIVATION INT_ERR DATATYPE 2 |
vector_CR[210]= 1119; // CTR DECRYPTION DERIVATION INT_ERR DATATYPE 3 |
|
vector_CR[211]= 6233; // CTR DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 0 |
vector_CR[212]= 6235; // CTR DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 1 |
vector_CR[213]= 6237; // CTR DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 2 |
vector_CR[214]= 6239; // CTR DECRYPTION DERIVATION DMA REGISTER ERROR DATATYPE 3 |
|
vector_CR[215]= 7257; // CTR DECRYPTION DERIVATION DMA INT_ERR DATATYPE 0 |
vector_CR[216]= 7259; // CTR DECRYPTION DERIVATION DMA INT_ERR DATATYPE 1 |
vector_CR[217]= 7261; // CTR DECRYPTION DERIVATION DMA INT_ERR DATATYPE 2 |
vector_CR[218]= 7263; // CTR DECRYPTION DERIVATION DMA INT_ERR DATATYPE 3 |
|
vector_CR[219]= 601; // CTR DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 0 |
vector_CR[220]= 603; // CTR DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 1 |
vector_CR[221]= 605; // CTR DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 2 |
vector_CR[222]= 607; // CTR DECRYPTION DERIVATION INT CCF REGISTER ERROR DATATYPE 3 |
|
vector_CR[223]= 1625; // CTR DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 0 |
vector_CR[224]= 1627; // CTR DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 1 |
vector_CR[225]= 1629; // CTR DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 2 |
vector_CR[226]= 1631; // CTR DECRYPTION DERIVATION INT CCF INT_ERR DATATYPE 3 |
|
vector_CR[227]= 73; // CTR KEY GENERATION REGISTER ERROR |
vector_CR[228]= 1097; // CTR KEY GENERATION INT_ERR |
|
vector_CR[229]= 6185; // CTR KEY GENERATION DMA REGISTER ERROR |
vector_CR[230]= 7209; // CTR KEY GENERATION DMA INT_ERR |
|
vector_CR[231]= 553; // CTR DECRYPTION DERIVATION INT CCF REGISTER ERROR |
vector_CR[232]= 1577; // CTR DECRYPTION DERIVATION INT CCF INT_ERR |
|
/* |
ADDR CASES DEFINITIONS |
*/ |
|
vector_address[0]= ADDR_AES_CR; |
vector_address[1]= ADDR_AES_KEYR3; |
vector_address[2]= ADDR_AES_KEYR2; |
154,23 → 452,10
vector_address[6]= ADDR_AES_IVR2; |
vector_address[7]= ADDR_AES_IVR1; |
vector_address[8]= ADDR_AES_IVR0; |
vector_address[9]= ADDR_AES_CR; |
vector_address[9]= ADDR_AES_SR; |
|
|
/* |
vector_address[0]= ADDR_AES_CR; |
vector_address[1]= ADDR_AES_SR; |
vector_address[2]= ADDR_AES_DINR; |
vector_address[3]= ADDR_AES_DOUTR; |
vector_address[4]= ADDR_AES_KEYR3; |
vector_address[5]= ADDR_AES_KEYR2; |
vector_address[6]= ADDR_AES_KEYR1; |
vector_address[7]= ADDR_AES_KEYR0; |
vector_address[8]= ADDR_AES_IVR3; |
vector_address[9]= ADDR_AES_IVR2; |
vector_address[10]=ADDR_AES_IVR1; |
vector_address[11]=ADDR_AES_IVR0; |
*/ |
|
v_initial.format=vpiIntVal; |
|
v_initial.value.integer = 0; |
/env_aes.c
126,6 → 126,8
unsigned long int M; |
unsigned long int N; |
|
unsigned long int O; |
|
int type_bfm; |
|
int STATE; |
135,9 → 137,10
int counter_monitor; |
int cycle_counter; |
|
|
int flag; |
|
int DATATYPE; |
|
int reset_counter; |
int counter_reset_enter; |
int counter_reset_wait; |
150,6 → 153,12
int counter_read; |
int counter_wait; |
|
/* DATATYPE */ |
#define TYPE_00 0 |
#define TYPE_01 1 |
#define TYPE_02 2 |
#define TYPE_03 3 |
|
/*AES REGISTERS*/ |
#define ADDR_AES_CR 0 |
#define ADDR_AES_SR 4 |
168,6 → 177,8
|
int vector_address[11]; |
|
int vector_CR[233]; |
|
/*STATE MACHINE TO WORK WITH BFM*/ |
#define IDLE 0 |
#define WRITE 1 |
189,7 → 200,7
|
#define AES_WR_ONLY 99 |
#define AES_WR_ERROR_DINR_ONLY 100 |
#define AES_WR_ERROR_DOUTR_ONLY 100 |
#define AES_WR_ERROR_DOUTR_ONLY 101 |
|
/*TEST USING NAMES TO ENABLE BFMs*/ |
#define ECB_ENCRYPTION 1 |
240,6 → 251,9
#define CTR_DERIVATION_DECRYPTION_CCFIE 35 |
#define CTR_KEY_GEN_CCFIE 36 |
|
/*SUFLE TEST*/ |
#define SUFLE_TEST 37 |
|
/*TYPE CONFIGURATION USED TO INSERT DATA ON DUT*/ |
#define FIPS 0 |
#define RANDOM_DATA 1 |
246,7 → 260,7
|
|
/*MAX PACKETS GENERATION*/ |
#define MAX_ITERATIONS 5 |
#define MAX_ITERATIONS 3 |
|
/*MAX RESET GENERATION */ |
#define MAX_RESET_TIMES 4 |
263,32 → 277,44
|
|
/*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 KEY_FIPS_NOT_DERIVATED[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F}; |
unsigned char TEXT_FIPS_NOT_DATATYPE_DERIVATED[] = {0x22,0x33,0x00,0x11,0x66,0x77,0x44,0x55,0xAA,0xBB,0x88,0x99,0xEE,0xFF,0xCC,0xDD}; |
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 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 TEXT_FIPS_DERIVATED[] = {0x69,0xC4,0xE0,0xD8,0x6A,0x7B,0x04,0x30,0xD8,0xCD,0xB7,0x80,0x70,0xB4,0xC5,0x5A}; |
unsigned char TEXT_FIPS_DATATYPE_T01_DERIVATED[] = {0xE0,0xD8,0x69,0xC4,0x04,0x30,0x6A,0x7B,0xB7,0x80,0xD8,0xCD,0xC5,0x5A,0x70,0xB4}; |
unsigned char TEXT_FIPS_DATATYPE_T02_DERIVATED[] = {0x15,0xDA,0x8D,0x52,0x27,0x77,0xA3,0x69,0x6D,0x2C,0x49,0x5B,0x08,0x13,0xBF,0x90}; |
unsigned char TEXT_FIPS_DATATYPE_T03_DERIVATED[] = {0xA3,0xB4,0x12,0xDA,0x43,0x04,0x7B,0x7C,0x21,0xEC,0x50,0x0A,0xDF,0x0B,0xF6,0x77}; |
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 IV_FIPS_CBC_NOT_DERIVATED[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F}; |
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 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_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_DATATYPE_DERIVATED[] = {0xBE,0xE2,0x6B,0xC1,0x9F,0x96,0x2E,0x40,0x7E,0x11,0xE9,0x3D,0x17,0x2A,0x73,0x93}; |
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 TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[] = {0xAB,0xAC,0x76,0x49,0xB2,0x46,0x81,0x19,0x8E,0x9B,0xCE,0xE9,0x19,0x7D,0x12,0xE9}; |
unsigned char TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[] = {0xCD,0x29,0x94,0xFC,0xF6,0xAE,0x27,0x96,0x7D,0xA4,0x45,0xFA,0x28,0x9E,0xE8,0x39}; |
unsigned char TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[] = {0x7F,0x59,0xFD,0x0E,0x0F,0x88,0xD0,0x32,0x7F,0x75,0x0E,0xB5,0x07,0x85,0xC3,0x4E}; |
|
|
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 TEXT_FIPS_CTR_NOT_DERIVATED[] = {0x6B,0xC1,0xBE,0xE2,0x2E,0x40,0x9F,0x96,0xE9,0x3D,0x7E,0x11,0x73,0x93,0x17,0x2A}; |
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 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_DATATYPE_DERIVATED[] = {0xBE,0xE2,0x6B,0xC1,0x9F,0x96,0x2E,0x40,0x7E,0x11,0xE9,0x3D,0x17,0x2A,0x73,0x93}; |
|
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_CTR_FIPS_DERIVATED[] = {0x87,0x4D,0x61,0x91,0xB6,0x20,0xE3,0x26,0x1B,0xEF,0x68,0x64,0x99,0x0D,0xB6,0xCE}; |
unsigned char TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[] = {0x61,0x91,0x87,0x4D,0xE3,0x26,0xB6,0x20,0x68,0x64,0x1B,0xEF,0xB6,0xCE,0x99,0x0D}; |
unsigned char TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[] = {0xCD,0x3D,0xE7,0x2D,0x2F,0xEA,0x4E,0xD8,0x0B,0x07,0x3B,0xCF,0xF3,0x8B,0xED,0x79}; |
unsigned char TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[] = {0x70,0x19,0x5A,0xF6,0x92,0xA8,0x28,0x59,0xD0,0x79,0xA2,0x72,0x30,0xAF,0x0A,0xC4}; |
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}; |
unsigned char TEXT_NULL[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; |
|
/*BFM CONTROL FLOW*/ |
#include "aes_bfm_generate.h" |
348,6 → 374,9
#include "bfm_ctr/aes_bfm_key_generation_ccfie_ctr.h" |
#include "bfm_ctr/aes_bfm_derivation_decryption_ccfie_ctr.h" |
|
/*SUFLE TEST*/ |
#include "random/aes_bfm_sufle.h" |
|
/*ENV CONFIG */ |
#include "aes_init.h" |
#include "aes_monitor.h" |
736,6 → 765,19
tf_data.user_data = 0; |
vpi_register_systf(&tf_data); |
|
//BFM SUFLE |
|
tf_data.type = vpiSysTask; |
tf_data.sysfunctype = 0; |
tf_data.tfname = "$bfm_sufle_aes128"; |
tf_data.calltf = aes_bfm_sufle_calltf; |
tf_data.compiletf = 0; |
tf_data.sizetf = 0; |
tf_data.user_data = 0; |
vpi_register_systf(&tf_data); |
|
|
|
// RESET BFM |
tf_data.type = vpiSysTask; |
tf_data.sysfunctype = 0; |
/aes_monitor.h
412,6 → 412,18
} |
|
|
if(v_monitor.value.integer == ADDR_AES_SR) |
{ |
vpi_get_value(PRDATA, &v_monitor_catch); |
//printf("%X\n",v_monitor_catch.value.integer); |
O =v_monitor_catch.value.integer; |
|
if(type_bfm == AES_WR_ERROR_DOUTR_ONLY || type_bfm == AES_WR_ERROR_DINR_ONLY) |
{ |
counter_monitor++; |
} |
} |
|
if(v_monitor.value.integer == ADDR_AES_DOUTR) |
{ |
|
473,13 → 485,38
// vpi_mcd_printf(1,"%d\n",counter_monitor); |
|
|
if(counter_monitor == 12 && FIPS_ENABLE == FIPS) |
if(counter_monitor == 12 && FIPS_ENABLE == FIPS) |
{ |
printf("Checking results\n\n"); |
counter_monitor = 0; |
|
if(I == 4094)// WR |
if(type_bfm == AES_WR_ERROR_DOUTR_ONLY) |
{ |
if(O == 2 || O == 6) |
{ |
printf("AES_WR_ERROR_DOUTR_ONLY PASS\n"); |
}else |
{ |
printf("AES_WR_ERROR_DOUTR_ONLY FAILs\n"); |
printf("%i\n",O); |
} |
|
|
}else if(type_bfm == AES_WR_ERROR_DINR_ONLY) |
{ |
|
if(O == 4) |
{ |
printf("AES_WR_ERROR_DINR_ONLY PASS\n"); |
}else |
{ |
printf("AES_WR_ERROR_DINR_ONLY FAILs\n"); |
printf("%i\n",O); |
} |
|
|
}else if(I == 4094)// WR |
{ |
if(memcmp(TEXT_NULL,OUTPUT_TEXT,16) == 0) |
{ |
printf("WRITE READ: TEXT CR DISABLED PASSED.\n"); |
504,266 → 541,1067
printf("WRITE READ: IVR WHEN CR DISABLED FAIL.\n"); |
} |
|
}else if(I == 1)//ECB ENCRYPTION |
}else if(I == 1)//ECB ENCRYPTION DATATYPE 00 |
{ |
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION: TEXT CYPHER PASSED.\n"); |
printf("ECB ENCRYPTION DATATYPE00: TEXT CYPHER PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION: TEXT CYPHER FAIL.\n"); |
printf("ECB ENCRYPTION DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("ECB ENCRYPTION DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("ECB ENCRYPTION DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION: IVR WHEN CR ENABLE PASSED.\n"); |
printf("ECB ENCRYPTION DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION: IVR WHEN CR ENABLE FAIL.\n"); |
printf("ECB ENCRYPTION DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6145 ) //ECB ENCRYPTION DMA |
}else if(I == 3)//ECB ENCRYPTION DATATYPE 01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DATATYPE_T01_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION DATATYPE01: TEXT CYPHER PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 5)//ECB ENCRYPTION DATATYPE 02 |
{ |
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DATATYPE_T02_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION DATATYPE02: TEXT CYPHER PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 7)//ECB ENCRYPTION DATATYPE 03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DATATYPE_T03_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION DATATYPE03: TEXT CYPHER PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6145 ) //ECB ENCRYPTION DMA DATATYPE 00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA: TEXT CYPHER WHEN CR ENABLE PASSED.\n"); |
printf("ECB ENCRYPTION DMA DATATYPE00 : TEXT CYPHER WHEN CR ENABLE PASSED.\n"); |
|
}else |
{ |
printf("ECB ENCRYPTION DMA: TEXT CYPHER WHEN CR ENABLE FAIL.\n"); |
printf("ECB ENCRYPTION DMA DATATYPE00 : TEXT CYPHER WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("ECB ENCRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("ECB ENCRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n"); |
printf("ECB ENCRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n"); |
printf("ECB ENCRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if (I == 513) // ECB ENCRYPTION CCFIE |
}else if(I == 6147 ) //ECB ENCRYPTION DMA DATATYPE 01 |
{ |
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DATATYPE_T01_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA DATATYPE01 : TEXT CYPHER WHEN CR ENABLE PASSED.\n"); |
|
}else |
{ |
printf("ECB ENCRYPTION DMA DATATYPE01 : TEXT CYPHER WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if (I == 6149 ) //ECB ENCRYPTION DMA DATATYPE 02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DATATYPE_T02_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA DATATYPE02 : TEXT CYPHER WHEN CR ENABLE PASSED.\n"); |
|
}else |
{ |
printf("ECB ENCRYPTION DMA DATATYPE02 : TEXT CYPHER WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if (I == 6151 ) //ECB ENCRYPTION DMA DATATYPE 03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DATATYPE_T03_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA DATATYPE03 : TEXT CYPHER WHEN CR ENABLE PASSED.\n"); |
|
}else |
{ |
printf("ECB ENCRYPTION DMA DATATYPE03 : TEXT CYPHER WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if (I == 513) //ECB ENCRYPTION CCFIE DATA TYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE: TEXT CYPHER PASSED.\n"); |
printf("ECB ENCRYPTION CCFIE DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB ENCRYPTION CCFIE: TEXT CYPHER FAIL.\n"); |
printf("ECB ENCRYPTION CCFIE DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("ECB ENCRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION CCFIE: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("ECB ENCRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE: IVR WHEN CR ENABLE PASSED.\n"); |
printf("ECB ENCRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION CCFIE: IVR WHEN CR ENABLE FAIL.\n"); |
printf("ECB ENCRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 25)// ECB DERIVATION DECRYPTION |
}else if(I == 515)//ECB ENCRYPTION CCFIE DATA TYPE01 |
{ |
|
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DATATYPE_T01_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 517)//ECB ENCRYPTION CCFIE DATA TYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DATATYPE_T02_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 519)//ECB ENCRYPTION CCFIE DATA TYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_DATATYPE_T03_DERIVATED,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB ENCRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 25)// ECB DERIVATION DECRYPTION DATA TYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION: TEXT CYPHER PASSED.\n"); |
printf("ECB DERIVATION DECRYPTION DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION: TEXT CYPHER FAIL.\n"); |
printf("ECB DERIVATION DECRYPTION DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DERIVATION DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DERIVATION DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION: IVR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DERIVATION DECRYPTION DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION: IVR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DERIVATION DECRYPTION DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6169)// ECB DERIVATION DECRYPTION DMA |
}else if(I == 27)// ECB DERIVATION DECRYPTION DATA TYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 29)// ECB DERIVATION DECRYPTION DATA TYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 31)// ECB DERIVATION DECRYPTION DATA TYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6169)// ECB DERIVATION DECRYPTION DMA DATA TYPE00 |
{ |
|
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA: TEXT CYPHER PASSED.\n"); |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA: TEXT CYPHER FAIL.\n"); |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 537)// ECB DERIVATION DECRYPTION CCFIE |
}else if(I == 6171)// ECB DERIVATION DECRYPTION DMA DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6173)// ECB DERIVATION DECRYPTION DMA DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 6175)// ECB DERIVATION DECRYPTION DMA DATATYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 537)// ECB DERIVATION DECRYPTION CCFIE DATA TYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA: TEXT CYPHER PASSED.\n"); |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA: TEXT CYPHER FAIL.\n"); |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 17)//ECB DECRYPTION |
}else if(I == 539)// ECB DERIVATION DECRYPTION CCFIE DATA TYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 541)// ECB DERIVATION DECRYPTION CCFIE DATA TYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 543)// ECB DERIVATION DECRYPTION CCFIE DATA TYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DERIVATION DECRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 17)//ECB DECRYPTION DATA TYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION: TEXT CYPHER PASSED.\n"); |
printf("ECB DECRYPTION DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION: TEXT CYPHER FAIL.\n"); |
printf("ECB DECRYPTION DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION: IVR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DECRYPTION DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION: IVR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DECRYPTION DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6161)//ECB DECRYPTION DMA |
}else if(I == 19)//ECB DECRYPTION DATA TYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 21)//ECB DECRYPTION DATA TYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 23)//ECB DECRYPTION DATA TYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6161)//ECB DECRYPTION DMA DATA TYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION DMA: TEXT CYPHER PASSED.\n"); |
printf("ECB DECRYPTION DMA DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION DMA: TEXT CYPHER FAIL.\n"); |
printf("ECB DECRYPTION DMA DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
}else if(I == 529)//ECB DECRYPTION CCFIE |
|
}else if(I == 6163)//ECB DECRYPTION DMA DATA TYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION DMA DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION DMA DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6165)//ECB DECRYPTION DMA DATA TYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION DMA DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION DMA DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6167)//ECB DECRYPTION DMA DATA TYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION DMA DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION DMA DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 529)//ECB DECRYPTION CCFIE DATATYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE: TEXT CYPHER PASSED.\n"); |
printf("ECB DECRYPTION CCFIE DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION CCFIE: TEXT CYPHER FAIL.\n"); |
printf("ECB DECRYPTION CCFIE DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DECRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION CCFIE: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DECRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE: IVR WHEN CR ENABLE PASSED.\n"); |
printf("ECB DECRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION CCFIE: IVR WHEN CR ENABLE FAIL.\n"); |
printf("ECB DECRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 531)//ECB DECRYPTION CCFIE DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 533)//ECB DECRYPTION CCFIE DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 535)//ECB DECRYPTION CCFIE DATATYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("ECB DECRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 9) //ECB KEY GENARATION |
{ |
|
851,173 → 1689,607
printf("ECB KEY GEN CCFIE: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 33) // ENCRYPTION CBC |
}else if(I == 33) // ENCRYPTION CBC DATA TYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION: TEXT CYPHER PASSED.\n"); |
printf("CBC ENCRYPTION DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION: TEXT CYPHER FAIL.\n"); |
printf("CBC ENCRYPTION DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 35) // ENCRYPTION CBC DATA TYPE01 |
{ |
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CBC ENCRYPTION DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CBC ENCRYPTION DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION: IVR WHEN CR ENABLE PASSED.\n"); |
printf("CBC ENCRYPTION DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION: IVR WHEN CR ENABLE FAIL.\n"); |
printf("CBC ENCRYPTION DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6177)//CBC ENCRYPTION DMA |
|
}else if(I == 37) // ENCRYPTION CBC DATA TYPE02 |
{ |
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 39) // ENCRYPTION CBC DATA TYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6177)//CBC ENCRYPTION DMA DATA TYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA: TEXT CYPHER PASSED.\n"); |
printf("CBC ENCRYPTION DMA DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION DMA: TEXT CYPHER FAIL.\n"); |
printf("CBC ENCRYPTION DMA DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6179)//CBC ENCRYPTION DMA DATA TYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION DMA DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CBC ENCRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CBC ENCRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n"); |
printf("CBC ENCRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n"); |
printf("CBC ENCRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 545)//CBC ENCRYPTION CCFIE |
|
}else if(I == 6181)//CBC ENCRYPTION DMA DATA TYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION DMA DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6183)//CBC ENCRYPTION DMA DATA TYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION DMA DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 545)//CBC ENCRYPTION CCFIE DATA TYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE: TEXT CYPHER PASSED.\n"); |
printf("CBC ENCRYPTION CCFIE DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION CCFIE: TEXT CYPHER FAIL.\n"); |
printf("CBC ENCRYPTION CCFIE DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 547)//CBC ENCRYPTION CCFIE DATA TYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CBC ENCRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION CCFIE: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CBC ENCRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE: IVR WHEN CR ENABLE PASSED.\n"); |
printf("CBC ENCRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION CCFIE: IVR WHEN CR ENABLE FAIL.\n"); |
printf("CBC ENCRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 49)// CBC DECRYPTION |
}else if(I == 549)//CBC ENCRYPTION CCFIE DATA TYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 551)//CBC ENCRYPTION CCFIE DATA TYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC ENCRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 49)// CBC DECRYPTION DATA TYPE00 |
{ |
|
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION : TEXT CYPHER PASSED.\n"); |
printf("CBC DECRYPTION DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION : TEXT CYPHER FAIL.\n"); |
printf("CBC DECRYPTION DATATYPE00: TEXT CYPHER FAIL.\n"); |
|
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 51)// CBC DECRYPTION DATA TYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION DATATYPE01: TEXT CYPHER FAIL.\n"); |
|
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION : KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION : KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION : IVR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DECRYPTION DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION : IVR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DECRYPTION DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 53)// CBC DECRYPTION DATA TYPE02 |
{ |
|
}else if(I == 3121)//CBC DECRYPTION DMA |
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION DATATYPE02: TEXT CYPHER FAIL.\n"); |
|
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 55)// CBC DECRYPTION DATA TYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION DATATYPE03: TEXT CYPHER FAIL.\n"); |
|
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6193)//CBC DECRYPTION DMA DATA TYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION DMA : TEXT CYPHER PASSED.\n"); |
printf("CBC DECRYPTION DMA DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION DMA : TEXT CYPHER FAIL.\n"); |
printf("CBC DECRYPTION DMA DATATYPE00: TEXT CYPHER FAIL.\n"); |
|
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DMA : KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DMA : KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DMA : IVR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DMA : IVR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 561)// CBC DECRYPTION CCFIE |
}else if(I == 6195)//CBC DECRYPTION DMA DATA TYPE01 |
{ |
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION DMA DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION DMA DATATYPE01: TEXT CYPHER FAIL.\n"); |
|
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6197)//CBC DECRYPTION DMA DATA TYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION DMA DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION DMA DATATYPE02: TEXT CYPHER FAIL.\n"); |
|
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6199)//CBC DECRYPTION DMA DATA TYPE03 |
{ |
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION DMA DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION DMA DATATYPE03: TEXT CYPHER FAIL.\n"); |
|
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 561)// CBC DECRYPTION CCFIE DATA TYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION : TEXT CYPHER PASSED.\n"); |
printf("CBC DECRYPTION CCFIE DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION : TEXT CYPHER FAIL.\n"); |
printf("CBC DECRYPTION CCFIE DATATYPE00: TEXT CYPHER FAIL.\n"); |
|
} |
|
1024,21 → 2296,119
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION : KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DECRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION : KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DECRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION : IVR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DECRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION : IVR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DECRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 563)// CBC DECRYPTION CCFIE DATATYPE01 |
{ |
|
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE01: TEXT CYPHER FAIL.\n"); |
|
} |
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE01 : KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE01 : KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE01 : IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE01 : IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 565)// CBC DECRYPTION CCFIE DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE02: TEXT CYPHER FAIL.\n"); |
|
} |
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE02 : KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE02 : KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE02 : IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE02 : IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 567)// CBC DECRYPTION CCFIE DATATYPE03 |
{ |
|
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE03: TEXT CYPHER FAIL.\n"); |
|
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DECRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 41) //CBC KEY GENERATION |
{ |
|
1099,7 → 2469,7
printf("CBC KEY GEN DMA : IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 297 ) //CBC KEY GENERATION CCFIE |
}else if(I == 553 ) //CBC KEY GENERATION CCFIE |
{ |
|
|
1128,102 → 2498,368
printf("CBC KEY GEN CCFIE : IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 57)// CBC DERIVATION DECRYPTION |
}else if(I == 57)// CBC DERIVATION DECRYPTION DATA TYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION : TEXT CYPHER PASSED.\n"); |
printf("CBC DERIVATION DECRYPTION DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION : TEXT CYPHER FAIL.\n"); |
printf("CBC DERIVATION DECRYPTION DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION : KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DERIVATION DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION : KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DERIVATION DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION : IVR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DERIVATION DECRYPTION DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION : IVR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DERIVATION DECRYPTION DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6201) // CBC DERIVATION DECRYPTION DMA |
}else if(I == 59)// CBC DERIVATION DECRYPTION DATA TYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
|
}else if(I == 61)// CBC DERIVATION DECRYPTION DATA TYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 63)// CBC DERIVATION DECRYPTION DATA TYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6201) // CBC DERIVATION DECRYPTION DMA DATATYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA : TEXT CYPHER PASSED.\n"); |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA : TEXT CYPHER FAIL.\n"); |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA : KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA : KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA : IVR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA : IVR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 569) // CBC DERIVATION DECRYPTION CCFIE |
}else if(I == 6203) // CBC DERIVATION DECRYPTION DMA DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 6205) // CBC DERIVATION DECRYPTION DMA DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6207) // CBC DERIVATION DECRYPTION DMA DATATYPE03 |
{ |
|
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 569) // CBC DERIVATION DECRYPTION CCFIE DATATYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE : TEXT CYPHER PASSED.\n"); |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE : TEXT CYPHER FAIL.\n"); |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE : KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE : KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE : IVR WHEN CR ENABLE PASSED.\n"); |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE : IVR WHEN CR ENABLE FAIL.\n"); |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 65)// CTR ENCFRYPTION |
}else if(I == 571) // CBC DERIVATION DECRYPTION CCFIE DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 573) // CBC DERIVATION DECRYPTION CCFIE DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 575) // CBC DERIVATION DECRYPTION CCFIE DATATYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CBC DERIVATION DECRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 65)// CTR ENCFRYPTION DATATYPE00 |
{ |
|
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION: TEXT CYPHER PASSED.\n"); |
printf("CTR ENCRYPTION DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION: TEXT CYPHER FAIL.\n"); |
printf("CTR ENCRYPTION DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
|
1230,34 → 2866,135
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CTR ENCRYPTION DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CTR ENCRYPTION DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION: IVR WHEN CR ENABLE PASSED.\n"); |
printf("CTR ENCRYPTION DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION: IVR WHEN CR ENABLE FAIL.\n"); |
printf("CTR ENCRYPTION DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 6209)// CTR ENCRYPTION DMA |
}else if(I == 67)// CTR ENCFRYPTION DATATYPE01 |
{ |
|
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 69)// CTR ENCFRYPTION DATATYPE02 |
{ |
|
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 71)// CTR ENCFRYPTION DATATYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 6209)// CTR ENCRYPTION DMA DATATYPE00 |
{ |
|
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA: TEXT CYPHER PASSED.\n"); |
printf("CTR ENCRYPTION DMA DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION DMA: TEXT CYPHER FAIL.\n"); |
printf("CTR ENCRYPTION DMA DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
|
1264,32 → 3001,123
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CTR ENCRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CTR ENCRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n"); |
printf("CTR ENCRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n"); |
printf("CTR ENCRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 577)// CTR ENCRYPTION CCFIE |
}else if(I == 6211)// CTR ENCRYPTION DMA DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION DMA DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6213)// CTR ENCRYPTION DMA DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION DMA DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 6215)// CTR ENCRYPTION DMA DATATYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION DMA DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 577)// CTR ENCRYPTION CCFIE DATATYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE: TEXT CYPHER PASSED.\n"); |
printf("CTR ENCRYPTION CCFIE DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION CCFIE: TEXT CYPHER FAIL.\n"); |
printf("CTR ENCRYPTION CCFIE DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
|
1296,63 → 3124,245
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CTR ENCRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION CCFIE: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CTR ENCRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE: IVR WHEN CR ENABLE PASSED.\n"); |
printf("CTR ENCRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION CCFIE: IVR WHEN CR ENABLE FAIL.\n"); |
printf("CTR ENCRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 81) //CTR DECRYPTION |
}else if(I == 579)// CTR ENCRYPTION CCFIE DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 581)// CTR ENCRYPTION CCFIE DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 583)// CTR ENCRYPTION CCFIE DATATYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR ENCRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 81) //CTR DECRYPTION DATATYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION : TEXT CYPHER PASSED.\n"); |
printf("CTR DECRYPTION DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION : TEXT CYPHER FAIL.\n"); |
printf("CTR DECRYPTION DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 83) //CTR DECRYPTION DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION : KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION : KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION : IVR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DECRYPTION DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION : IVR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DECRYPTION DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6225) //CTR DECRYPTION DMA |
}else if(I == 85) //CTR DECRYPTION DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 87) //CTR DECRYPTION DATATYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 6225) //CTR DECRYPTION DMA DATATYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION DMA: TEXT CYPHER PASSED.\n"); |
printf("CTR DECRYPTION DMA DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION DMA: TEXT CYPHER FAIL.\n"); |
printf("CTR DECRYPTION DMA DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
|
1359,32 → 3369,129
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 593) //CTR DECRYPTION CCFIE |
}else if(I == 6227) //CTR DECRYPTION DMA DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION DMA DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION DMA DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6229) //CTR DECRYPTION DMA DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION DMA DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION DMA DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6231) //CTR DECRYPTION DMA DATATYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION DMA DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION DMA DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 593) //CTR DECRYPTION CCFIE DATATYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE: TEXT CYPHER PASSED.\n"); |
printf("CTR DECRYPTION CCFIE DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION CCFIE: TEXT CYPHER FAIL.\n"); |
printf("CTR DECRYPTION CCFIE DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
|
1391,109 → 3498,469
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DECRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION CCFIE: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DECRYPTION CCFIE DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE: IVR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DECRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION CCFIE: IVR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DECRYPTION CCFIE DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 89) //CTR DERIVATION DECRYPTION |
}else if(I == 595) //CTR DECRYPTION CCFIE DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 597) //CTR DECRYPTION CCFIE DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 599) //CTR DECRYPTION CCFIE DATATYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DECRYPTION CCFIE DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 89) //CTR DERIVATION DECRYPTION DATATYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION: TEXT CYPHER PASSED.\n"); |
printf("CTR DERIVATION DECRYPTION DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION: TEXT CYPHER FAIL.\n"); |
printf("CTR DERIVATION DECRYPTION DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DERIVATION DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DERIVATION DECRYPTION DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION: IVR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DERIVATION DECRYPTION DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION: IVR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DERIVATION DECRYPTION DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 6233) //CTR DERIVATION DECRYPTION DMA |
}else if(I == 91) //CTR DERIVATION DECRYPTION DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 93) //CTR DERIVATION DECRYPTION DATATYPE02 |
{ |
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 95) //CTR DERIVATION DECRYPTION DATATYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6233) //CTR DERIVATION DECRYPTION DMA DATATYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA: TEXT CYPHER PASSED.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA: TEXT CYPHER FAIL.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 601) //CTR DERIVATION DECRYPTION CCFIE |
}else if(I == 6235) //CTR DERIVATION DECRYPTION DMA DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6237) //CTR DERIVATION DECRYPTION DMA DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
}else if(I == 6239) //CTR DERIVATION DECRYPTION DMA DATATYPE03 |
{ |
|
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
|
}else if(I == 601) //CTR DERIVATION DECRYPTION CCFIE DATATYPE00 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA: TEXT CYPHER PASSED.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA: TEXT CYPHER FAIL.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA: KEYR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE PASSED.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA: IVR WHEN CR ENABLE FAIL.\n"); |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE00: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 603) //CTR DERIVATION DECRYPTION CCFIE DATATYPE01 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE01: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 605) //CTR DERIVATION DECRYPTION CCFIE DATATYPE02 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE02: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 607) //CTR DERIVATION DECRYPTION CCFIE DATATYPE03 |
{ |
|
if(memcmp(OUTPUT_TEXT,TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: TEXT CYPHER PASSED.\n"); |
|
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: TEXT CYPHER FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_KEYR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: KEYR WHEN CR ENABLE FAIL.\n"); |
} |
|
if(memcmp(OUTPUT_IVR,TEXT_NULL,16) == 0) |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE PASSED.\n"); |
}else |
{ |
printf("CTR DERIVATION DECRYPTION DMA DATATYPE03: IVR WHEN CR ENABLE FAIL.\n"); |
} |
|
}else if(I == 73)// CTR KEY GENERATION |
{ |
|
1590,7 → 4057,12
|
|
}//counter == 12 |
else |
{ |
|
|
} |
|
} |
|
|
/bfm_cbc/aes_bfm_decryption_ccfie_cbc.h
295,14 → 295,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 561; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 561; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 563; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 565; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 567; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
317,51 → 341,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_cbc/aes_bfm_encryption_cbc.h
301,11 → 301,38
}else if(counter_write == 9)//ENABLE CR |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 33; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 33; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 35; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 37; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 39; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR |
{ |
317,51 → 344,107
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 12 ) |
{ |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 12 ) |
{ |
|
}else if(counter_write == 13 ) |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE > TYPE_00) |
{ |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
} |
|
|
/bfm_cbc/aes_bfm_encryption_dma_cbc.h
302,14 → 302,38
}else if(counter_write == 9)//ENABLE CR |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
//v_ecb.value.integer = 1; |
//vpi_put_value(PWDATA, &v_ecb, NULL, vpiNoDelay); |
v_ecb.value.integer = 6177; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
v_ecb.value.integer = 6177;//data_in(rd); |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6179; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6181; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6183; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR |
{ |
321,51 → 345,107
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 12 ) |
{ |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 12 ) |
{ |
|
}else if(counter_write == 13 ) |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE > TYPE_00) |
{ |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
} |
|
|
/bfm_cbc/aes_bfm_key_generation_ccfie_cbc.h
302,7 → 302,7
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 297; |
v_ecb.value.integer = 553; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
} |
/bfm_cbc/aes_bfm_derivation_decryption_ccfie_cbc.h
295,14 → 295,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 569;//data_in(rd); |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 569; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 571; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 573; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 575; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
317,50 → 341,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_cbc/aes_bfm_decryption_cbc.h
295,14 → 295,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 49; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 49; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 51; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 53; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 55; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
317,51 → 341,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_cbc/aes_bfm_decryption_dma_cbc.h
295,14 → 295,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 6193; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 6193; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6195; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6197; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6199; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
317,51 → 341,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_cbc/aes_bfm_encryption_ccfie_cbc.h
299,11 → 299,38
}else if(counter_write == 9)//ENABLE CR |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 545; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 545; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 547; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 549; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 551; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR |
{ |
315,51 → 342,107
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 12 ) |
{ |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 12 ) |
{ |
|
}else if(counter_write == 13 ) |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE > TYPE_00) |
{ |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CBC_NOT_DATATYPE_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
} |
|
|
/bfm_cbc/aes_bfm_derivation_decryption_cbc.h
295,14 → 295,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 57;//data_in(rd); |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 57; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 59; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 61; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 63; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
317,51 → 341,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_cbc/aes_bfm_derivation_decryption_dma_cbc.h
295,14 → 295,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 6201; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 6201; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6203; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6205; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6207; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
317,53 → 341,213
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CBC_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CBC_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CBC_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CBC_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
|
}else if(FIPS_ENABLE == RANDOM_DATA) |
{ |
v_ecb.value.integer = data_in(rd); |
/aes_bfm_generate.h
85,12 → 85,14
if(v_generate.value.integer == 1) |
{ |
|
FIPS_ENABLE = FIPS; |
type_bfm = AES_WR_ONLY; |
FIPS_ENABLE =RANDOM_DATA; |
DATATYPE = TYPE_00; |
|
// type_bfm = AES_WR_ONLY; |
// type_bfm = AES_WR_ERROR_DINR_ONLY; |
// type_bfm = AES_WR_ERROR_DOUTR_ONLY; |
|
// type_bfm = ECB_ENCRYPTION; |
type_bfm = ECB_ENCRYPTION; |
// type_bfm = ECB_DECRYPTION; |
// type_bfm = ECB_KEY_GEN; |
// type_bfm = ECB_DERIVATION_DECRYPTION; |
126,18 → 128,19
// type_bfm = CTR_KEY_GEN; |
// type_bfm = CTR_DERIVATION_DECRYPTION; |
|
|
// type_bfm = CTR_ENCRYPTION_DMA; |
// type_bfm = CTR_DECRYPTION_DMA; |
// type_bfm = CTR_KEY_GEN_DMA; |
// type_bfm = CTR_DERIVATION_DECRYPTION_DMA; |
|
|
// type_bfm = CTR_ENCRYPTION_CCFIE; |
// type_bfm = CTR_DECRYPTION_CCFIE; |
// type_bfm = CTR_KEY_GEN_CCFIE; |
// type_bfm = CTR_DERIVATION_DECRYPTION_CCFIE; |
|
// type_bfm = SUFLE_TEST; |
|
|
if(PACKETS_GENERATED == MAX_ITERATIONS) |
{ |
v_generate.value.integer = 1; |
/bfm_ctr/aes_bfm_derivation_decryption_dma_ctr.h
295,14 → 295,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 6233; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 6233; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6235; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6237; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6239; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
317,50 → 341,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_ctr/aes_bfm_decryption_ccfie_ctr.h
295,14 → 295,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 593; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 593; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 595; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 597; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 599; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
317,51 → 341,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_ctr/aes_bfm_encryption_ctr.h
301,11 → 301,38
}else if(counter_write == 9)//ENABLE CR |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 65; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 65; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 67; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 69; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 71; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR |
{ |
317,51 → 344,107
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 12 ) |
{ |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 12 ) |
{ |
|
}else if(counter_write == 13 ) |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE > TYPE_00) |
{ |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
} |
|
|
/bfm_ctr/aes_bfm_encryption_dma_ctr.h
302,14 → 302,38
}else if(counter_write == 9)//ENABLE CR |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
//v_ecb.value.integer = 1; |
//vpi_put_value(PWDATA, &v_ecb, NULL, vpiNoDelay); |
v_ecb.value.integer = 6209; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
v_ecb.value.integer = 6209;//data_in(rd); |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6211; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6213; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6215; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR |
{ |
321,54 → 345,109
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 12 ) |
{ |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 12 ) |
{ |
|
}else if(counter_write == 13 ) |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE > TYPE_00) |
{ |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
} |
|
|
}else if(FIPS_ENABLE == RANDOM_DATA) |
{ |
v_ecb.value.integer = data_in(rd); |
/bfm_ctr/aes_bfm_derivation_decryption_ccfie_ctr.h
295,14 → 295,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 601;//data_in(rd); |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 601; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 603; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 605; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 607; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
317,53 → 341,213
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
|
}else if(FIPS_ENABLE == RANDOM_DATA) |
{ |
v_ecb.value.integer = data_in(rd); |
/bfm_ctr/aes_bfm_decryption_ctr.h
295,14 → 295,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 81; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 81; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 83; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 85; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 87; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
317,51 → 341,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_ctr/aes_bfm_decryption_dma_ctr.h
296,14 → 296,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 6225; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 6225; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6227; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6229; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6231; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
318,51 → 342,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_ctr/aes_bfm_encryption_ccfie_ctr.h
297,11 → 297,38
}else if(counter_write == 9)//ENABLE CR |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 577; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 577; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 579; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 581; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 583; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR |
{ |
313,51 → 340,107
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 12 ) |
{ |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 12 ) |
{ |
|
}else if(counter_write == 13 ) |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE > TYPE_00) |
{ |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_CTR_NOT_DATATYPE_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
} |
|
|
/bfm_ctr/aes_bfm_derivation_decryption_ctr.h
295,14 → 295,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 89; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 89; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 91; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 93; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 95; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
317,51 → 341,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_CTR_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_CTR_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_CTR_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_CTR_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_ecb/aes_bfm_derivation_decryption_ecb.h
243,14 → 243,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 25;//data_in(rd); |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 25; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 27; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 29; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 31; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
265,51 → 289,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_ecb/aes_bfm_derivation_decryption_dma_ecb.h
243,14 → 243,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 6169; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 6169; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6171; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6173; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6175; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
265,51 → 289,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_ecb/aes_bfm_decryption_ccfie_ecb.h
243,14 → 243,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 529; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 529; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 531; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 533; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 535; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
265,51 → 289,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_ecb/aes_bfm_encryption_ecb.h
248,11 → 248,38
}else if(counter_write == 9)//ENABLE CR |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 1; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 1; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 3; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 5; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 7; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR |
{ |
264,51 → 291,107
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 12 ) |
{ |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
c = c | TEXT_FIPS_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 12 ) |
{ |
|
}else if(counter_write == 13 ) |
c = c | TEXT_FIPS_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE > TYPE_00) |
{ |
d = d | TEXT_FIPS_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
} |
|
|
317,7 → 400,9
v_ecb.value.integer = data_in(rd); |
} |
|
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
vpi_put_value(PWDATA, &v_ecb, NULL, vpiNoDelay); |
|
//vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
a = 0; |
b = 0; |
336,6 → 421,8
{ |
counter_write = 0; |
STATE = WAIT_SR; |
|
|
} |
|
break; |
342,6 → 429,7
|
case WAIT_SR: |
|
|
v_ecb.value.integer = ADDR_AES_SR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
/bfm_ecb/aes_bfm_encryption_dma_ecb.h
251,15 → 251,38
}else if(counter_write == 9)//ENABLE CR |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
//v_ecb.value.integer = 1; |
//vpi_put_value(PWDATA, &v_ecb, NULL, vpiNoDelay); |
v_ecb.value.integer = 6145; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
v_ecb.value.integer = 6145;//data_in(rd); |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6147; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6149; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6151; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR |
{ |
|
270,51 → 293,107
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 12 ) |
{ |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
c = c | TEXT_FIPS_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 12 ) |
{ |
|
}else if(counter_write == 13 ) |
c = c | TEXT_FIPS_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE > TYPE_00) |
{ |
d = d | TEXT_FIPS_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
} |
|
|
/bfm_ecb/aes_bfm_derivation_decryption_ccfie_ecb.h
243,14 → 243,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 537;//data_in(rd); |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 537; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 539; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 541; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 543; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
265,51 → 289,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_ecb/aes_bfm_decryption_ecb.h
243,14 → 243,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 17; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 17; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 19; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 21; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 23; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
265,51 → 289,209
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
/bfm_ecb/aes_bfm_decryption_dma_ecb.h
266,14 → 266,38
if(counter_write == 9) |
{ |
|
v_ecb.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
t_ecb.type = vpiScaledRealTime; |
t_ecb.real = 0; |
v_ecb.format=vpiIntVal; |
v_ecb.value.integer = 6161; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 6161; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6163; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6165; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 6167; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
} |
|
288,54 → 312,211
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_01) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE == TYPE_02) |
{ |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 13 ) |
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
}else if(DATATYPE == TYPE_03) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
v_ecb.value.integer = d; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
|
|
} |
|
|
}else if(FIPS_ENABLE == RANDOM_DATA) |
{ |
v_ecb.value.integer = data_in(rd); |
/bfm_ecb/aes_bfm_encryption_ccfie_ecb.h
248,11 → 248,39
}else if(counter_write == 9)//ENABLE CR |
{ |
|
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 513; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
v_ecb.value.integer = 513; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 515; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 517; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA |
{ |
v_ecb.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay); |
|
v_ecb.value.integer = 519; |
; |
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay); |
} |
|
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR |
{ |
264,51 → 292,107
if(FIPS_ENABLE == FIPS) |
{ |
|
if(counter_write == 10) |
if(DATATYPE == TYPE_00) |
{ |
a = a | TEXT_FIPS_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 12 ) |
{ |
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
c = c | TEXT_FIPS_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
}else if(counter_write == 12 ) |
{ |
|
}else if(counter_write == 13 ) |
c = c | TEXT_FIPS_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
}else if(DATATYPE > TYPE_00) |
{ |
d = d | TEXT_FIPS_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[3]; |
v_ecb.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[7]; |
v_ecb.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[11]; |
v_ecb.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[15]; |
v_ecb.value.integer = d; |
|
} |
|
} |
|
|
/bfm_error/aes_bfm_wr_error_dinr.h
122,10 → 122,14
|
counter = 0; |
|
v_wr.value.integer = vector_address[0]; |
|
v_wr.value.integer = 0; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 1; |
133,6 → 137,7
|
v_wr.value.integer = 1; |
vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay); |
|
} |
|
|
141,296 → 146,174
|
case WRITE: |
|
|
|
|
|
if(counter == 0) |
{ |
|
counter++; |
counter_write++; |
counter++; |
|
v_wr.value.integer = 1; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
|
}else if(counter == 1) |
{ |
}else if( counter == 1 ) |
{ |
|
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
t_wr.type = vpiScaledRealTime; |
t_wr.real = 0; |
v_wr.format=vpiIntVal; |
|
if(counter_write < 9) |
{ |
|
v_wr.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
v_wr.value.integer = vector_address[counter_write]; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
if(FIPS_ENABLE == FIPS) |
{ |
if(vector_address[counter_write] == ADDR_AES_KEYR3 || vector_address[counter_write] == ADDR_AES_IVR3) |
{ |
|
if(vector_address[counter_write] == ADDR_AES_KEYR3 || vector_address[counter_write] == ADDR_AES_IVR3) |
{ |
a = a | KEY_FIPS_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | KEY_FIPS_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | KEY_FIPS_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | KEY_FIPS_NOT_DERIVATED[3]; |
v_wr.value.integer = a; |
} |
a = a | KEY_FIPS_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | KEY_FIPS_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | KEY_FIPS_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | KEY_FIPS_NOT_DERIVATED[3]; |
v_wr.value.integer = a; |
} |
|
if(vector_address[counter_write] == ADDR_AES_KEYR2 || vector_address[counter_write] == ADDR_AES_IVR2) |
{ |
|
if(vector_address[counter_write] == ADDR_AES_KEYR2 || vector_address[counter_write] == ADDR_AES_IVR2) |
{ |
b = b | KEY_FIPS_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | KEY_FIPS_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | KEY_FIPS_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | KEY_FIPS_NOT_DERIVATED[7]; |
v_wr.value.integer = b; |
} |
b = b | KEY_FIPS_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | KEY_FIPS_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | KEY_FIPS_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | KEY_FIPS_NOT_DERIVATED[7]; |
v_wr.value.integer = b; |
|
if(vector_address[counter_write] == ADDR_AES_KEYR1 || vector_address[counter_write] == ADDR_AES_IVR1) |
{ |
} |
|
if(vector_address[counter_write] == ADDR_AES_KEYR1 || vector_address[counter_write] == ADDR_AES_IVR1) |
{ |
c = c | KEY_FIPS_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | KEY_FIPS_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | KEY_FIPS_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | KEY_FIPS_NOT_DERIVATED[11]; |
v_wr.value.integer = c; |
} |
|
c = c | KEY_FIPS_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | KEY_FIPS_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | KEY_FIPS_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | KEY_FIPS_NOT_DERIVATED[11]; |
v_wr.value.integer = c; |
|
} |
if(vector_address[counter_write] == ADDR_AES_KEYR0 || vector_address[counter_write] == ADDR_AES_IVR0) |
{ |
|
if(vector_address[counter_write] == ADDR_AES_KEYR0 || vector_address[counter_write] == ADDR_AES_IVR0) |
{ |
d = d | KEY_FIPS_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | KEY_FIPS_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | KEY_FIPS_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | KEY_FIPS_NOT_DERIVATED[15]; |
v_wr.value.integer = d; |
} |
d = d | KEY_FIPS_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | KEY_FIPS_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | KEY_FIPS_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | KEY_FIPS_NOT_DERIVATED[15]; |
v_wr.value.integer = d; |
|
} |
|
|
}else if(FIPS_ENABLE == RANDOM_DATA) |
{ |
v_wr.value.integer = data_in(rd); |
} |
vpi_put_value(PWDATA, &v_wr, &t_wr, vpiTransportDelay); |
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
|
a = 0; |
b = 0; |
c = 0; |
d = 0; |
|
v_wr.value.integer = 1; |
vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay); |
|
|
}else if(counter_write == 9) |
a = 0; |
b = 0; |
c = 0; |
d = 0; |
|
}else if(counter_write == 9)//ENABLE CR |
{ |
|
v_wr.value.integer = vector_address[0]; |
v_wr.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
if(PACKETS_GENERATED == 0)//ENCRYPTION |
{ |
|
v_wr.value.integer = 1; |
|
|
}else if(PACKETS_GENERATED == 1)//ENCRYPTION |
{ |
|
v_wr.value.integer = 1025; |
|
|
}else if(PACKETS_GENERATED == 2)//KEY GENERATION |
{ |
|
v_wr.value.integer = 9; |
|
|
}else if(PACKETS_GENERATED == 3)//KEY GENERATION |
{ |
|
v_wr.value.integer = 1033; |
|
|
}else if(PACKETS_GENERATED == 4)//DECRYPTION |
{ |
|
v_wr.value.integer = 17; |
|
|
}else if(PACKETS_GENERATED == 5)//DECRYPTION |
{ |
|
v_wr.value.integer = 1041; |
|
|
}else if(PACKETS_GENERATED == 6)//DEVIRATION_DECRYPTION |
{ |
|
v_wr.value.integer = 25; |
|
|
}else if(PACKETS_GENERATED == 7)//DEVIRATION_DECRYPTION |
{ |
|
v_wr.value.integer = 1049; |
|
|
}else if(PACKETS_GENERATED == 8)//ENCRYPTION_DMA |
{ |
|
v_wr.value.integer = 6145; |
|
|
}else if(PACKETS_GENERATED == 9)//ENCRYPTION_DMA |
{ |
|
v_wr.value.integer = 7169; |
|
|
}else if(PACKETS_GENERATED == 10)//KEY DERIVATION DMA |
{ |
|
v_wr.value.integer = 6153; |
|
|
}else if(PACKETS_GENERATED == 12)//KEY DERIVATION DMA |
{ |
|
v_wr.value.integer = 7177; |
|
|
}else if(PACKETS_GENERATED == 13)//DECRYPTION_DMA |
{ |
|
v_wr.value.integer = 6161; |
|
|
}else if(PACKETS_GENERATED == 14)//DECRYPTION_DMA |
{ |
|
v_wr.value.integer = 7185; |
|
|
}else if(PACKETS_GENERATED == 15)//DEVIRATION_DECRYPTION_DMA |
{ |
|
v_wr.value.integer = 6169; |
|
}else if(PACKETS_GENERATED == 16)//DEVIRATION_DECRYPTION_DMA |
{ |
|
v_wr.value.integer = 7193; |
|
} |
|
v_wr.value.integer = vector_CR[PACKETS_GENERATED]; |
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
|
}if(counter_write > 9 && counter_write < 14) //WRITE DINR |
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR |
{ |
|
v_wr.value.integer = ADDR_AES_DINR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
|
if(FIPS_ENABLE == FIPS) |
{ |
|
|
v_wr.value.integer = ADDR_AES_DINR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
if(counter_write == 10) |
{ |
a = a | TEXT_FIPS_DERIVATED[0]; |
a = a | TEXT_FIPS_NOT_DERIVATED[0]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[1]; |
a = a | TEXT_FIPS_NOT_DERIVATED[1]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[2]; |
a = a | TEXT_FIPS_NOT_DERIVATED[2]; |
a = a << 8; |
a = a | TEXT_FIPS_DERIVATED[3]; |
a = a | TEXT_FIPS_NOT_DERIVATED[3]; |
v_wr.value.integer = a; |
|
}else if(counter_write == 11) |
{ |
b = b | TEXT_FIPS_DERIVATED[4]; |
b = b | TEXT_FIPS_NOT_DERIVATED[4]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[5]; |
b = b | TEXT_FIPS_NOT_DERIVATED[5]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[6]; |
b = b | TEXT_FIPS_NOT_DERIVATED[6]; |
b = b << 8; |
b = b | TEXT_FIPS_DERIVATED[7]; |
b = b | TEXT_FIPS_NOT_DERIVATED[7]; |
v_wr.value.integer = b; |
|
}else if(counter_write == 12 ) |
{ |
|
c = c | TEXT_FIPS_DERIVATED[8]; |
c = c | TEXT_FIPS_NOT_DERIVATED[8]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[9]; |
c = c | TEXT_FIPS_NOT_DERIVATED[9]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[10]; |
c = c | TEXT_FIPS_NOT_DERIVATED[10]; |
c = c << 8; |
c = c | TEXT_FIPS_DERIVATED[11]; |
c = c | TEXT_FIPS_NOT_DERIVATED[11]; |
v_wr.value.integer = c; |
|
}else if(counter_write == 13 ) |
{ |
d = d | TEXT_FIPS_DERIVATED[12]; |
d = d | TEXT_FIPS_NOT_DERIVATED[12]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[13]; |
d = d | TEXT_FIPS_NOT_DERIVATED[13]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[14]; |
d = d | TEXT_FIPS_NOT_DERIVATED[14]; |
d = d << 8; |
d = d | TEXT_FIPS_DERIVATED[15]; |
d = d | TEXT_FIPS_NOT_DERIVATED[15]; |
v_wr.value.integer = d; |
|
} |
|
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
|
}else if(FIPS_ENABLE == RANDOM_DATA) |
{ |
v_wr.value.integer = data_in(rd); |
} |
|
vpi_put_value(PWDATA, &v_wr, &t_wr, vpiTransportDelay); |
|
a = 0; |
b = 0; |
c = 0; |
d = 0; |
a = 0; |
b = 0; |
c = 0; |
d = 0; |
|
|
} |
|
counter=0; |
counter=0; |
} |
|
}//ELSE COUNTER |
|
|
|
if(counter_write == 14) |
{ |
STATE =WAIT; |
counter_write = 0; |
counter_read = 0; |
|
//v_wr.value.integer = 0; |
//vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
|
STATE = WAIT; |
} |
|
|
439,38 → 322,39
case WAIT: |
|
|
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
if(counter_wait == 9) |
if(counter_wait == 1) |
{ |
|
v_wr.value.integer = 1; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
STATE = WRITE_DINR; |
counter_wait=0; |
counter_write = 0; |
counter=1; |
|
v_wr.value.integer = ADDR_AES_DINR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
|
}else |
{ |
|
counter_wait++; |
|
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
} |
break; |
|
case WRITE_DINR: |
|
v_wr.value.integer = 1; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
|
|
if(counter == 0) |
{ |
|
487,6 → 371,25
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
if(counter_write == 13)//ENABLE CR |
{ |
|
v_wr.value.integer =1; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
|
}else |
{ |
v_wr.value.integer = ADDR_AES_DINR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
} |
|
|
counter=0; |
} |
|
497,14 → 400,8
STATE = READ_RESULTS; |
counter_write = 0; |
counter_read = 0; |
counter=1; |
|
v_wr.value.integer = ADDR_AES_DINR;//vector_address[counter_read]; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
|
} |
|
|
514,45 → 411,53
|
|
|
v_wr.value.integer = 0; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 1; |
vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay); |
|
if(counter == 0) |
{ |
|
v_wr.value.integer = 1; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
counter_read++; |
counter++; |
|
|
}else if(counter == 1) |
{ |
counter++; |
|
|
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
|
v_wr.value.integer = ADDR_AES_SR;//vector_address[counter_read]; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
if(counter_read <= 9) |
{ |
v_wr.value.integer = vector_address[counter_read]; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
} |
else |
{ |
|
v_wr.value.integer = 0; |
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 1; |
vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay); |
} |
|
|
|
counter=0; |
|
} |
|
if(counter_read == 12) |
if(counter_read == 14) |
{ |
STATE = RESET_SR; |
counter_read = 0; |
PACKETS_GENERATED = PACKETS_GENERATED + 1; |
|
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
counter=1; |
|
} |
|
560,19 → 465,9
|
case RESET_SR: |
|
v_wr.value.integer = 1; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 1; |
vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 384; |
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
|
|
if(counter == 0) |
{ |
|
587,14 → 482,30
|
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 1; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 1; |
vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 384; |
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
|
counter=0; |
|
} |
|
if(counter_write < 2) |
if(counter_write == 2) |
{ |
STATE =IDLE; |
counter_write = 0; |
counter=1; |
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
} |
|
|
/bfm_error/aes_bfm_wr_error_doutr.h
122,7 → 122,7
|
counter = 0; |
|
v_wr.value.integer = vector_address[0]; |
v_wr.value.integer = 0; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
241,105 → 241,10
}else if(counter_write == 9) |
{ |
|
v_wr.value.integer = vector_address[0]; |
v_wr.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
if(PACKETS_GENERATED == 0)//ENCRYPTION |
{ |
|
v_wr.value.integer = 1; |
|
|
}else if(PACKETS_GENERATED == 1)//ENCRYPTION |
{ |
|
v_wr.value.integer = 1025; |
|
|
}else if(PACKETS_GENERATED == 2)//KEY GENERATION |
{ |
|
v_wr.value.integer = 9; |
|
|
}else if(PACKETS_GENERATED == 3)//KEY GENERATION |
{ |
|
v_wr.value.integer = 1033; |
|
|
}else if(PACKETS_GENERATED == 4)//DECRYPTION |
{ |
|
v_wr.value.integer = 17; |
|
|
}else if(PACKETS_GENERATED == 5)//DECRYPTION |
{ |
|
v_wr.value.integer = 1041; |
|
|
}else if(PACKETS_GENERATED == 6)//DEVIRATION_DECRYPTION |
{ |
|
v_wr.value.integer = 25; |
|
|
}else if(PACKETS_GENERATED == 7)//DEVIRATION_DECRYPTION |
{ |
|
v_wr.value.integer = 1049; |
|
|
}else if(PACKETS_GENERATED == 8)//ENCRYPTION_DMA |
{ |
|
v_wr.value.integer = 6145; |
|
|
}else if(PACKETS_GENERATED == 9)//ENCRYPTION_DMA |
{ |
|
v_wr.value.integer = 7169; |
|
|
}else if(PACKETS_GENERATED == 10)//KEY DERIVATION DMA |
{ |
|
v_wr.value.integer = 6153; |
|
|
}else if(PACKETS_GENERATED == 12)//KEY DERIVATION DMA |
{ |
|
v_wr.value.integer = 7177; |
|
|
}else if(PACKETS_GENERATED == 13)//DECRYPTION_DMA |
{ |
|
v_wr.value.integer = 6161; |
|
|
}else if(PACKETS_GENERATED == 14)//DECRYPTION_DMA |
{ |
|
v_wr.value.integer = 7185; |
|
|
}else if(PACKETS_GENERATED == 15)//DEVIRATION_DECRYPTION_DMA |
{ |
|
v_wr.value.integer = 6169; |
|
}else if(PACKETS_GENERATED == 16)//DEVIRATION_DECRYPTION_DMA |
{ |
|
v_wr.value.integer = 7193; |
|
} |
|
v_wr.value.integer = vector_CR[PACKETS_GENERATED]; |
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
|
}if(counter_write > 9 && counter_write < 14) //WRITE DINR |
427,9 → 332,6
counter_write = 0; |
counter_read = 0; |
|
|
|
|
} |
|
|
444,22 → 346,19
v_wr.value.integer = 0; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
if(counter_wait == 9) |
if(counter_wait == 3) |
{ |
|
STATE = READ_DOUTR; |
counter_wait=0; |
counter=1; |
|
v_wr.value.integer = ADDR_AES_DOUTR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
|
}else |
{ |
|
v_wr.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
counter_wait++; |
|
} |
467,14 → 366,12
|
case READ_DOUTR: |
|
v_wr.value.integer = 0; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
if(counter == 0) |
{ |
|
counter++; |
counter_write++; |
counter_read++; |
|
v_wr.value.integer = 1; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
486,24 → 383,21
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
|
v_wr.value.integer = ADDR_AES_DOUTR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
counter=0; |
} |
|
|
|
if(counter_write == 14) |
if(counter_read == 4) |
{ |
STATE = READ_RESULTS; |
counter_write = 0; |
counter_read = 0; |
|
v_wr.value.integer = ADDR_AES_DINR;//vector_address[counter_read]; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
|
counter=1; |
} |
|
|
524,37 → 418,96
|
}else if(counter == 1) |
{ |
counter++; |
|
|
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
if(counter_read == 0) |
{ |
v_wr.value.integer = 1; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = ADDR_AES_SR;//vector_address[counter_read]; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
v_wr.value.integer = ADDR_AES_CR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
v_wr.value.integer = 0; |
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 1; |
vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay); |
v_wr.value.integer = 1; |
vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay); |
}else |
{ |
v_wr.value.integer = 0; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = ADDR_AES_SR; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
|
} |
|
counter=0; |
|
} |
|
if(counter_read == 1) |
if(counter_read == 14) |
{ |
STATE = IDLE; |
counter_read = 0; |
STATE = RESET_SR; |
counter_write = 0; |
counter_read = 0; |
PACKETS_GENERATED = PACKETS_GENERATED + 1; |
counter=1; |
|
v_wr.value.integer = 0; |
} |
|
break; |
|
case RESET_SR: |
|
|
|
|
if(counter == 0) |
{ |
|
counter_write++; |
counter++; |
|
v_wr.value.integer = 1; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
}else if(counter == 1) |
{ |
|
v_wr.value.integer = 0; |
vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 1; |
vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 1; |
vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 0; |
vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay); |
|
v_wr.value.integer = 384; |
vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay); |
|
counter=0; |
|
} |
|
if(counter_write == 2) |
{ |
STATE =IDLE; |
counter_write = 0; |
counter_read = 0; |
} |
|
|
|
break; |
} |
|