Commit 5d4b98c1 by farnoud farahmand

Revert "Hardware verified"

This reverts commit 756b492c.
parent 756b492c
......@@ -438,12 +438,14 @@ encrypt_cca(
TxBuffer[0]= 0x0000000000008800;
//memcpy(TxBuffer+1, h, 443*2);
for(tx_rx_c =1; tx_rx_c < 744; tx_rx_c ++) {
TxBuffer[tx_rx_c] = complement & h[744 - tx_rx_c -1];
// initialize RxBuffer with 0's
TxBuffer[tx_rx_c] = complement & h[tx_rx_c -1];
}
TxBuffer[744]= 0x0000000000008200;
for(tx_rx_c =745; tx_rx_c < 1239; tx_rx_c ++) {
// initialize RxBuffer with 0's
TxBuffer[tx_rx_c] = complement & r_pos[tx_rx_c-745];
}
......@@ -464,9 +466,9 @@ encrypt_cca(
xil_printf("\r\n Encrypt Mult Execution Time (ENC) = %d \r\n", execution_time);
#endif
for(tx_rx_c = 0; tx_rx_c < 743; tx_rx_c++) {
t[742-tx_rx_c] = RxBuffer[tx_rx_c+2];
}
for(tx_rx_c = 0; tx_rx_c < 744; tx_rx_c++) {
t[tx_rx_c] = RxBuffer[tx_rx_c+2];
}
}else{
#if ROTATION_ON
......@@ -576,11 +578,13 @@ int decrypt_cca(
TxBuffer[0]= 0x0000000000008400;
//memcpy(TxBuffer+1, h, 443*2);
for(tx_rx_c =1; tx_rx_c < 495; tx_rx_c ++) {
// initialize RxBuffer with 0's
TxBuffer[tx_rx_c] = complement & F_pos[tx_rx_c -1];
}
TxBuffer[495]= 0x0000000000009100;
for(tx_rx_c =496; tx_rx_c < 1239; tx_rx_c ++) {
TxBuffer[tx_rx_c] = complement & c[1239-tx_rx_c-1];
// initialize RxBuffer with 0's
TxBuffer[tx_rx_c] = complement & c[tx_rx_c-496];
}
......@@ -602,7 +606,7 @@ int decrypt_cca(
#endif
for(tx_rx_c = 0; tx_rx_c < 743; tx_rx_c++) {
m[742-tx_rx_c] = RxBuffer[tx_rx_c+2];
m[tx_rx_c] = RxBuffer[tx_rx_c+2];
}
}else{
#if ROTATION_ON
......@@ -674,6 +678,7 @@ int decrypt_cca(
TxBuffer[0]= 0x0000000000009200;
//memcpy(TxBuffer+1, h, 443*2);
for(tx_rx_c =1; tx_rx_c < 495; tx_rx_c ++) {
// initialize RxBuffer with 0's
TxBuffer[tx_rx_c] = complement & r_pos[tx_rx_c -1];
}
......@@ -695,7 +700,7 @@ int decrypt_cca(
#endif
for(tx_rx_c = 0; tx_rx_c < 743; tx_rx_c++) {
t_rec[742-tx_rx_c] = RxBuffer[tx_rx_c+1];
t_rec[tx_rx_c] = RxBuffer[tx_rx_c+1];
}
}else{
#if ROTATION_ON
......@@ -711,6 +716,7 @@ int decrypt_cca(
#if POLY_MUL_EXE
XTmrCtr_Stop(&TMRInst, 0);
// Read Timer value
execution_time = XTmrCtr_GetValue(&TMRInst, 0);
xil_printf("\r\n Decrypt Mult Execution Time (DEC2) = %d \r\n", execution_time);
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment