General utilities cleanup. Add signature support to catcrypt. Throw in
[u/mdw/catacomb] / twofish-mktab.c
index d7290b3..4acbf73 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: twofish-mktab.c,v 1.2 2000/06/18 23:12:15 mdw Exp $
+ * $Id: twofish-mktab.c,v 1.5 2004/04/08 01:36:15 mdw Exp $
  *
  * Build constant tables for Twofish
  *
  * MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: twofish-mktab.c,v $
- * Revision 1.2  2000/06/18 23:12:15  mdw
- * Change typesetting of Galois Field names.
- *
- * Revision 1.1  2000/06/17 12:10:17  mdw
- * New cipher.
- *
- */
-
 /*----- Header files ------------------------------------------------------*/
 
 #include <stdio.h>
@@ -313,7 +302,7 @@ static void rslog(void)
   unsigned i;
 
   rslog[0] = 0;
-  for (i = 0; i < 256; i++) {
+  for (i = 0; i < 255; i++) {
     rslog[x] = i;
     rsexp[i] = x;
     x <<= 1;
@@ -353,7 +342,7 @@ static void rslog(void)
   for (i = 0; i < 255 + x + 1; i++) {
     printf("0x%02x", rsexp[i % 255]);
     if (i == 255 + x)
-      puts("                           \\\n}\n");
+      puts("                                           \\\n}\n");
     else if (i % 8 == 7)
       fputs(",                 \\\n  ", stdout);
     else
@@ -384,14 +373,14 @@ static void rslog(void)
 int main(void)
 {
   fputs("\
-/* -*-c-*-
- *
+/* -*-c-*-\n\
+ *\n\
  * Twofish q tables [generated]\n\
- */
-
-#ifndef CATACOMB_TWOFISH_TAB_H
-#define CATACOMB_TWOFISH_TAB_H
-
+ */\n\
+\n\
+#ifndef CATACOMB_TWOFISH_TAB_H\n\
+#define CATACOMB_TWOFISH_TAB_H\n\
+\n\
 ", stdout);
 
   /* --- The q tables --- */