Generate precomputed tables as sources in `precomps/'.
[u/mdw/catacomb] / symm / des-mktab.c
index 5dc8c4a..7dad026 100644 (file)
@@ -246,33 +246,24 @@ int main(void)
  * DES tables [generated]\n\
  */\n\
 \n\
-#ifndef CATACOMB_DES_TAB_H\n\
-#define CATACOMB_DES_TAB_H\n\
+#include \"des-base.h\"\n\
 \n\
-#define DES_SP {                                                       \\\n\
+const uint32 des_sp[8][64] = {\n\
 ", stdout);
   for (i = 0; i < 8; i++) {
     mangle(s[i], ss, 28 - 4 * i);
-    printf("\
-                                                                       \\\n\
-  /* --- SP[%i] --- */                                                 \\\n\
-                                                                       \\\n\
-", i);
+    printf("\n  /* --- SP[%i] --- */\n\n", i);
     sep = "  { ";
     for (j = 0; j < 64; j++) {
       printf("%s0x%08lx", sep, ss[j]);
       if (j % 4 == 3)
-       sep = ",                        \\\n    ";
+       sep = ",\n    ";
       else
        sep = ", ";
     }
-    printf(" }%s                       \\\n", i == 7 ? "" : ",");
+    printf(" }%s\n", i == 7 ? "" : ",");
   }
-  fputs("\
-}\n\
-\n\
-#endif\n\
-", stdout);
+  fputs("};\n", stdout);
 
   if (fclose(stdout)) {
     fprintf(stderr, "error writing data\n");