From: Mark Wooding Date: Mon, 22 Dec 2014 20:32:58 +0000 (+0000) Subject: symm/seal.c: Fix IV handling through `gcipher' interface. X-Git-Tag: 2.2.0~7^2~3 X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/3af7e5375683a92458076bf971124973b9389a0f symm/seal.c: Fix IV handling through `gcipher' interface. * Read the IV as octets (big-endian) rather than as a machine word. * Advertise a `block size' of 4 octets. This is a compatibility break, but I don't think anyone was using SEAL, and it was nearly impossible to use correctly through this interface anyway. --- diff --git a/symm/seal.c b/symm/seal.c index da9d0843..57cfc10f 100644 --- a/symm/seal.c +++ b/symm/seal.c @@ -413,8 +413,8 @@ static void gencrypt(gcipher *c, const void *s, void *t, size_t sz) 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) @@ -430,7 +430,7 @@ static const gcipher_ops gops = { }; const gccipher seal = { - "seal", seal_keysz, 0, + "seal", seal_keysz, 4, ginit };