* Use: Initializes a SEAL key table.
*/
-static void gamma(uint32 *p, size_t sz, const void *k, unsigned i)
+static void sealgamma(uint32 *p, size_t sz, const void *k, unsigned i)
{
uint32 buf[80] = { 0 };
const octet *kk = k;
/* --- Expand the key to fit the various tables --- */
- gamma(k->t, 512, k->k, 0);
- gamma(k->s, 256, k->k, 0x1000);
- gamma(k->r, SEAL_R, k->k, 0x2000);
+ sealgamma(k->t, 512, k->k, 0);
+ sealgamma(k->s, 256, k->k, 0x1000);
+ sealgamma(k->r, SEAL_R, k->k, 0x2000);
}
/* --- @seal_reset@ --- *
/* --- Initialize the new chaining variables --- */
if (c->l >= SEAL_R) {
- gamma(c->rbuf, SEAL_R, k->k, c->ri);
+ sealgamma(c->rbuf, SEAL_R, k->k, c->ri);
c->ri += SEAL_R;
c->l = 0;
c->r = c->rbuf;
static void gsetiv(gcipher *c, const void *iv)
{
gctx *g = (gctx *)c;
- uint32 n = *(const uint32 *)iv;
- seal_initctx(&g->cc, &g->k, n);
+ const octet *ivp = iv;
+ seal_initctx(&g->cc, &g->k, LOAD32(ivp));
}
static void gdestroy(gcipher *c)
};
const gccipher seal = {
- "seal", seal_keysz, 0,
+ "seal", seal_keysz, 4,
ginit
};