X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/0f00dc4c8eb47e67bc0f148c2dd109f73a451e0a..3e248c3b5b309bc03eb5f70762d3f5671d51f996:/misc/gfshare.c diff --git a/misc/gfshare.c b/misc/gfshare.c index 0eb076b..80a6ef6 100644 --- a/misc/gfshare.c +++ b/misc/gfshare.c @@ -37,12 +37,11 @@ #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 ---------------------------------------------------------*/ @@ -121,7 +120,7 @@ void gfshare_get(gfshare *s, unsigned x, void *buf) { 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$% --- */ @@ -134,7 +133,7 @@ void gfshare_get(gfshare *s, unsigned x, void *buf) 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++; } } @@ -233,10 +232,10 @@ void gfshare_combine(gfshare *s, void *buf) 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; } @@ -249,7 +248,7 @@ void gfshare_combine(gfshare *s, void *buf) 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++; } }