X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/7cee294a99758676a598cf0b3b914b0dea42d506..ea932d59b3071ce00f9e510aad014ad64a3dc48c:/rijndael.c diff --git a/rijndael.c b/rijndael.c index 981e79c..9eb5f21 100644 --- a/rijndael.c +++ b/rijndael.c @@ -1,13 +1,13 @@ /* -*-c-*- * - * $Id: rijndael.c,v 1.4 2001/05/07 17:31:53 mdw Exp $ + * $Id: rijndael.c,v 1.5 2004/04/08 01:36:15 mdw Exp $ * * The Rijndael block cipher * * (c) 2000 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Catacomb. * @@ -15,35 +15,18 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * Catacomb is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with Catacomb; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: rijndael.c,v $ - * Revision 1.4 2001/05/07 17:31:53 mdw - * Separate out key scheduling. - * - * Revision 1.3 2001/05/07 15:44:46 mdw - * Fix unusual numbers of rounds. Simplify implementation. - * - * 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. - * - */ - /*----- Header files ------------------------------------------------------*/ #include @@ -106,7 +89,7 @@ void rijndael_eblk(const rijndael_ctx *k, const uint32 *s, uint32 *dst) { uint32 a = s[0], b = s[1], c = s[2], d = s[3]; uint32 aa, bb, cc, dd; - uint32 *w = k->w; + const uint32 *w = k->w; a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++; aa = a; bb = b; cc = c; dd = d; @@ -141,7 +124,7 @@ void rijndael_dblk(const rijndael_ctx *k, const uint32 *s, uint32 *dst) { uint32 a = s[0], b = s[1], c = s[2], d = s[3]; uint32 aa, bb, cc, dd; - uint32 *w = k->wi; + const uint32 *w = k->wi; a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++; aa = a; bb = b; cc = c; dd = d;