#include "blkc.h"
#include "gcipher.h"
#include "skipjack.h"
-#include "skipjack-tab.h"
/*----- Global variables --------------------------------------------------*/
/*----- The Skipjack S-box ------------------------------------------------*/
-static const octet f[256] = SKIPJACK_S;
+extern const octet skipjack_s[256];
/*----- Main code ---------------------------------------------------------*/
#define G(x, k) do { \
octet _x = U8(x >> 8), _y = U8(x); \
- _x ^= f[_y ^ U8(k >> 24)]; \
- _y ^= f[_x ^ U8(k >> 16)]; \
- _x ^= f[_y ^ U8(k >> 8)]; \
- _y ^= f[_x ^ U8(k >> 0)]; \
+ _x ^= skipjack_s[_y ^ U8(k >> 24)]; \
+ _y ^= skipjack_s[_x ^ U8(k >> 16)]; \
+ _x ^= skipjack_s[_y ^ U8(k >> 8)]; \
+ _y ^= skipjack_s[_x ^ U8(k >> 0)]; \
x = (_x << 8) | _y; \
} while (0)
#define G_INV(x, k) do { \
octet _x = U8(x >> 8), _y = U8(x); \
- _y ^= f[_x ^ U8(k >> 0)]; \
- _x ^= f[_y ^ U8(k >> 8)]; \
- _y ^= f[_x ^ U8(k >> 16)]; \
- _x ^= f[_y ^ U8(k >> 24)]; \
+ _y ^= skipjack_s[_x ^ U8(k >> 0)]; \
+ _x ^= skipjack_s[_y ^ U8(k >> 8)]; \
+ _y ^= skipjack_s[_x ^ U8(k >> 16)]; \
+ _x ^= skipjack_s[_y ^ U8(k >> 24)]; \
x = (_x << 8) | _y; \
} while (0)