/* -*-c-*-
*
- * $Id: rijndael192.c,v 1.1 2001/05/07 17:32:03 mdw Exp $
+ * $Id: rijndael192.c,v 1.2 2004/04/08 01:36:15 mdw Exp $
*
* The Rijndael block cipher, 192-bit version
*
* (c) 2001 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Catacomb.
*
* 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: rijndael192.c,v $
- * Revision 1.1 2001/05/07 17:32:03 mdw
- * New Rijndael block sizes.
- *
- */
-
/*----- Header files ------------------------------------------------------*/
#include <assert.h>
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5];
uint32 aa, bb, cc, dd, ee, ff;
- uint32 *w = k->w;
+ const uint32 *w = k->w;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++; e ^= *w++; f ^= *w++;
aa = a; bb = b; cc = c; dd = d; ee = e; ff = f;
DO(MIX, T, aa, bb, cc, dd, ee, ff, a, b, c, d, e, f, w);
DO(MIX, T, a, b, c, d, e, f, aa, bb, cc, dd, ee, ff, w);
DO(MIX, T, aa, bb, cc, dd, ee, ff, a, b, c, d, e, f, w);
- }
+ }
DO(SUB, S, a, b, c, d, e, f, aa, bb, cc, dd, ee, ff, w);
dst[0] = a; dst[1] = b; dst[2] = c; dst[3] = d; dst[4] = e; dst[5] = f;
{
uint32 a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5];
uint32 aa, bb, cc, dd, ee, ff;
- uint32 *w = k->wi;
+ const uint32 *w = k->wi;
a ^= *w++; b ^= *w++; c ^= *w++; d ^= *w++; e ^= *w++; f ^= *w++;
aa = a; bb = b; cc = c; dd = d; ee = e; ff = f;
UNDO(MIX, TI, aa, bb, cc, dd, ee, ff, a, b, c, d, e, f, w);
UNDO(MIX, TI, a, b, c, d, e, f, aa, bb, cc, dd, ee, ff, w);
UNDO(MIX, TI, aa, bb, cc, dd, ee, ff, a, b, c, d, e, f, w);
- }
+ }
UNDO(SUB, SI, a, b, c, d, e, f, aa, bb, cc, dd, ee, ff, w);
dst[0] = a; dst[1] = b; dst[2] = c; dst[3] = d; dst[4] = e; dst[5] = f;