#include "arena.h"
#include "gfshare.h"
-#include "gfshare-tab.h"
#include "grand.h"
/*----- Static variables --------------------------------------------------*/
-static const octet gflog[] = GFSHARE_LOG, gfexp[] = GFSHARE_EXP;
+extern const octet gfshare_log[256], gfshare_exp[510];
/*----- Main code ---------------------------------------------------------*/
{
unsigned i;
const octet *p = s->v;
- unsigned ilog = gflog[x + 1];
+ unsigned ilog = gfshare_log[x + 1];
/* --- Evaluate the polynomial at %$x = i + 1$% --- */
for (k = 0; k < s->sz; k++) {
unsigned qq = *q;
if (qq)
- qq = gfexp[ilog + gflog[qq]];
+ qq = gfshare_exp[ilog + gfshare_log[qq]];
*q++ = qq ^ *p++;
}
}
if (i == j)
continue;
xj = GFSHARE_INDEX(s, j);
- c += gflog[xj];
+ c += gfshare_log[xj];
if (c >= 0xff)
c -= 0xff;
- ci += gflog[xi ^ xj];
+ ci += gfshare_log[xi ^ xj];
if (ci >= 0xff)
ci -= 0xff;
}
p = buf;
for (j = 0; j < s->sz; j++) {
if (*q)
- *p ^= gfexp[c + gflog[*q]];
+ *p ^= gfshare_exp[c + gfshare_log[*q]];
p++, q++;
}
}