/* -*-c-*-
*
- * $Id: blowfish.c,v 1.2 2000/06/17 10:47:56 mdw Exp $
+ * $Id: blowfish.c,v 1.4 2004/04/08 01:36:15 mdw Exp $
*
* The Blowfish block cipher
*
* (c) 1998 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: blowfish.c,v $
- * Revision 1.2 2000/06/17 10:47:56 mdw
- * Tidy round function a little. Support new key size interface.
- *
- * Revision 1.1 1999/09/03 08:41:11 mdw
- * Initial import.
- *
- */
-
/*----- Header files ------------------------------------------------------*/
#include <mLib/bits.h>
/*----- Global variables --------------------------------------------------*/
-static blowfish_ctx ikey = BLOWFISH_IKEY;
+static const blowfish_ctx ikey = BLOWFISH_IKEY;
const octet blowfish_keysz[] = { KSZ_RANGE, BLOWFISH_KEYSZ, 1, 56, 1 };
x ^= *r; \
y ^= ((k->s0[U8(x >> 24)] + \
k->s1[U8(x >> 16)]) ^ \
- k->s2[U8(x >> 8)]) + \
- k->s3[U8(x >> 0)]; \
+ k->s2[U8(x >> 8)]) + \
+ k->s3[U8(x >> 0)]; \
} while (0)
#define EBLK(k, a, b, c, d) do { \