X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/3a65506d4df316377c9b838ef5954b5d856215ee..b17f4ed54206a7d04c8da024c1b1e5de2056a877:/rijndael.c diff --git a/rijndael.c b/rijndael.c index 66797d5..9eeb59b 100644 --- a/rijndael.c +++ b/rijndael.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: rijndael.c,v 1.1 2000/06/17 11:56:07 mdw Exp $ + * $Id: rijndael.c,v 1.2 2000/12/06 20:32:59 mdw Exp $ * * The Rijndael block cipher * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: rijndael.c,v $ + * Revision 1.2 2000/12/06 20:32:59 mdw + * Fix round count for weird key sizes. + * * Revision 1.1 2000/06/17 11:56:07 mdw * New cipher. * @@ -92,12 +95,9 @@ void rijndael_init(rijndael_ctx *k, const void *buf, size_t sz) /* --- Select the number of rounds --- */ - if (nk < 5) + nr = nk + 6; + if (nr < 10) nr = 10; - else if (nk > 7) - nr = 14; - else - nr = 12; k->nr = nr; /* --- Fetch the first key words out --- */