(rslog): Ensure that log(1) = 0 (not 255, as previously). While the two
authormdw <mdw>
Mon, 26 Jun 2000 17:14:42 +0000 (17:14 +0000)
committermdw <mdw>
Mon, 26 Jun 2000 17:14:42 +0000 (17:14 +0000)
are strictly equivalent, it means that the exp table is larger than it
otherwise needs to be.

twofish-mktab.c

index d7290b3..e30d4cc 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.3 2000/06/26 17:14:42 mdw Exp $
  *
  * Build constant tables for Twofish
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: twofish-mktab.c,v $
+ * Revision 1.3  2000/06/26 17:14:42  mdw
+ * (rslog): Ensure that log(1) = 0 (not 255, as previously).  While the two
+ * are strictly equivalent, it means that the exp table is larger than it
+ * otherwise needs to be.
+ *
  * Revision 1.2  2000/06/18 23:12:15  mdw
  * Change typesetting of Galois Field names.
  *
@@ -313,7 +318,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 +358,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