Commit d4275e07 authored by YUSHIQIAN's avatar YUSHIQIAN

pcc[64]

parent 0b14b976
......@@ -326,7 +326,7 @@ dpa_attack (void)
tr_pcc_context pcc_ctx;
float *t; /* Power trace */
float *pcc;
float *pcc[64];
n = tr_number (ctx); /* Number of traces in context */
l = tr_length (ctx); /* number of points per trace */
......@@ -371,7 +371,7 @@ dpa_attack (void)
for(g = 0; g < 64; g++)
{
/*printf("get pcc======\n");*/
pcc = tr_pcc_get_pcc(pcc_ctx, g);
pcc[g] = tr_pcc_get_pcc(pcc_ctx, g);
/*printf("PCC(X[.], Y%d)[.] =", g);*/
for(i = 0; i < l; i++)
......@@ -381,14 +381,14 @@ dpa_attack (void)
if (i < 300 || i > 600)
{
pcc[i] = 0.0;
pcc[g][i] = 0.0;
}
}
/* pick two maximum dpa */
max = tr_max (ctx, pcc, &idx); /* Get max and argmax of DPA trace */
max = tr_max (ctx, pcc[g], &idx); /* Get max and argmax of DPA trace */
if (s == 0 && g == 60){printf("======%f, %d", max, idx);}
if (max > best_max[s][0] || g == 0) /* If better than current best max (or if first guess) */
......
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