Generate precomputed tables as sources in `precomps/'.
[u/mdw/catacomb] / symm / md2.c
index 180bc65..79bc472 100644 (file)
 #include "ghash-def.h"
 #include "hash.h"
 #include "md2.h"
-#include "md2-tab.h"
 
 /*----- Tables ------------------------------------------------------------*/
 
-static const octet s[256] = MD2_S;
+extern const octet md2_s[256];
 
 /*----- Main code ---------------------------------------------------------*/
 
@@ -76,7 +75,7 @@ void md2_compress(md2_ctx *ctx, const void *sbuf)
 
   t = 0;
   for (i = 0; i < 18; i++) {
-#define X(z, i) t = z[i] ^= s[t];
+#define X(z, i) t = z[i] ^= md2_s[t];
     DO(X, ctx->h);
     DO(X, x);
     DO(X, y);
@@ -87,7 +86,7 @@ void md2_compress(md2_ctx *ctx, const void *sbuf)
   /* --- Now compute the checksum --- */
 
   t = ctx->c[MD2_BUFSZ - 1];
-#define X(z, i) t = ctx->c[i] ^= s[z[i] ^ t]
+#define X(z, i) t = ctx->c[i] ^= md2_s[z[i] ^ t]
   DO(X, ((const octet *)sbuf));
 #undef X