static void precompute()

in src/gcm.c [62:85]


static void precompute(gcm *g,const uchar *H)
{
    /* precompute small 2k bytes gf2m table of x^n.H */
    int i;
    int j;
    const unsign32 *last;
    unsign32 *next;
    unsign32 b;

    for (i=j=0; i<NB; i++,j+=4) g->table[0][i]=pack(&H[j]);

    for (i=1; i<128; i++)
    {
        next=g->table[i];
        last=g->table[i-1];
        b=0;
        for (j=0; j<NB; j++)
        {
            next[j]=b|(last[j])>>1;
            b=last[j]<<31;
        }
        if (b) next[0]^=0xE1000000; /* irreducible polynomial */
    }
}