summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-02-17 18:09:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-02-17 18:09:56 +0000
commite87bd06433c9c3ed129321f904d555057fddd0ef (patch)
tree39cd8e7e263fc380b66f1b7497c7afc0de6d0d2c /sys
parent659730a173a6780111b95325c95a113297ad8dcc (diff)
indent; remove local types
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_cast.c202
-rw-r--r--sys/netinet/ip_cast.h17
-rw-r--r--sys/netinet/ip_castsb.h18
3 files changed, 117 insertions, 120 deletions
diff --git a/sys/netinet/ip_cast.c b/sys/netinet/ip_cast.c
index af565c5041c..ed4fe63a1b7 100644
--- a/sys/netinet/ip_cast.c
+++ b/sys/netinet/ip_cast.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_cast.c,v 1.2 1998/11/24 10:04:06 niklas Exp $ */
+/* $OpenBSD: ip_cast.c,v 1.3 1999/02/17 18:09:55 deraadt Exp $ */
/*
* CAST-128 in C
* Written by Steve Reid <sreid@sea-to-sky.net>
@@ -11,10 +11,10 @@
#include <netinet/ip_castsb.h>
/* Macros to access 8-bit bytes out of a 32-bit word */
-#define U8a(x) ( (u8) (x>>24) )
-#define U8b(x) ( (u8) ((x>>16)&255) )
-#define U8c(x) ( (u8) ((x>>8)&255) )
-#define U8d(x) ( (u8) ((x)&255) )
+#define U_INT8_Ta(x) ( (u_int8_t) (x>>24) )
+#define U_INT8_Tb(x) ( (u_int8_t) ((x>>16)&255) )
+#define U_INT8_Tc(x) ( (u_int8_t) ((x>>8)&255) )
+#define U_INT8_Td(x) ( (u_int8_t) ((x)&255) )
/* Circular left shift */
#define ROL(x, n) ( ((x)<<(n)) | ((x)>>(32-(n))) )
@@ -22,29 +22,29 @@
/* CAST-128 uses three different round functions */
#define F1(l, r, i) \
t = ROL(key->xkey[i] + r, key->xkey[i+16]); \
- l ^= ((cast_sbox1[U8a(t)] ^ cast_sbox2[U8b(t)]) - \
- cast_sbox3[U8c(t)]) + cast_sbox4[U8d(t)];
+ l ^= ((cast_sbox1[U_INT8_Ta(t)] ^ cast_sbox2[U_INT8_Tb(t)]) - \
+ cast_sbox3[U_INT8_Tc(t)]) + cast_sbox4[U_INT8_Td(t)];
#define F2(l, r, i) \
t = ROL(key->xkey[i] ^ r, key->xkey[i+16]); \
- l ^= ((cast_sbox1[U8a(t)] - cast_sbox2[U8b(t)]) + \
- cast_sbox3[U8c(t)]) ^ cast_sbox4[U8d(t)];
+ l ^= ((cast_sbox1[U_INT8_Ta(t)] - cast_sbox2[U_INT8_Tb(t)]) + \
+ cast_sbox3[U_INT8_Tc(t)]) ^ cast_sbox4[U_INT8_Td(t)];
#define F3(l, r, i) \
t = ROL(key->xkey[i] - r, key->xkey[i+16]); \
- l ^= ((cast_sbox1[U8a(t)] + cast_sbox2[U8b(t)]) ^ \
- cast_sbox3[U8c(t)]) - cast_sbox4[U8d(t)];
+ l ^= ((cast_sbox1[U_INT8_Ta(t)] + cast_sbox2[U_INT8_Tb(t)]) ^ \
+ cast_sbox3[U_INT8_Tc(t)]) - cast_sbox4[U_INT8_Td(t)];
/***** Encryption Function *****/
-void cast_encrypt(cast_key* key, u8* inblock, u8* outblock)
+void cast_encrypt(cast_key* key, u_int8_t* inblock, u_int8_t* outblock)
{
-u32 t, l, r;
+u_int32_t t, l, r;
/* Get inblock into l,r */
- l = ((u32)inblock[0] << 24) | ((u32)inblock[1] << 16) |
- ((u32)inblock[2] << 8) | (u32)inblock[3];
- r = ((u32)inblock[4] << 24) | ((u32)inblock[5] << 16) |
- ((u32)inblock[6] << 8) | (u32)inblock[7];
+ l = ((u_int32_t)inblock[0] << 24) | ((u_int32_t)inblock[1] << 16) |
+ ((u_int32_t)inblock[2] << 8) | (u_int32_t)inblock[3];
+ r = ((u_int32_t)inblock[4] << 24) | ((u_int32_t)inblock[5] << 16) |
+ ((u_int32_t)inblock[6] << 8) | (u_int32_t)inblock[7];
/* Do the work */
F1(l, r, 0);
F2(r, l, 1);
@@ -66,14 +66,14 @@ u32 t, l, r;
F1(r, l, 15);
}
/* Put l,r into outblock */
- outblock[0] = U8a(r);
- outblock[1] = U8b(r);
- outblock[2] = U8c(r);
- outblock[3] = U8d(r);
- outblock[4] = U8a(l);
- outblock[5] = U8b(l);
- outblock[6] = U8c(l);
- outblock[7] = U8d(l);
+ outblock[0] = U_INT8_Ta(r);
+ outblock[1] = U_INT8_Tb(r);
+ outblock[2] = U_INT8_Tc(r);
+ outblock[3] = U_INT8_Td(r);
+ outblock[4] = U_INT8_Ta(l);
+ outblock[5] = U_INT8_Tb(l);
+ outblock[6] = U_INT8_Tc(l);
+ outblock[7] = U_INT8_Td(l);
/* Wipe clean */
t = l = r = 0;
}
@@ -81,15 +81,15 @@ u32 t, l, r;
/***** Decryption Function *****/
-void cast_decrypt(cast_key* key, u8* inblock, u8* outblock)
+void cast_decrypt(cast_key* key, u_int8_t* inblock, u_int8_t* outblock)
{
-u32 t, l, r;
+u_int32_t t, l, r;
/* Get inblock into l,r */
- r = ((u32)inblock[0] << 24) | ((u32)inblock[1] << 16) |
- ((u32)inblock[2] << 8) | (u32)inblock[3];
- l = ((u32)inblock[4] << 24) | ((u32)inblock[5] << 16) |
- ((u32)inblock[6] << 8) | (u32)inblock[7];
+ r = ((u_int32_t)inblock[0] << 24) | ((u_int32_t)inblock[1] << 16) |
+ ((u_int32_t)inblock[2] << 8) | (u_int32_t)inblock[3];
+ l = ((u_int32_t)inblock[4] << 24) | ((u_int32_t)inblock[5] << 16) |
+ ((u_int32_t)inblock[6] << 8) | (u_int32_t)inblock[7];
/* Do the work */
/* Only do full 16 rounds if key length > 80 bits */
if (key->rounds > 12) {
@@ -111,14 +111,14 @@ u32 t, l, r;
F2(r, l, 1);
F1(l, r, 0);
/* Put l,r into outblock */
- outblock[0] = U8a(l);
- outblock[1] = U8b(l);
- outblock[2] = U8c(l);
- outblock[3] = U8d(l);
- outblock[4] = U8a(r);
- outblock[5] = U8b(r);
- outblock[6] = U8c(r);
- outblock[7] = U8d(r);
+ outblock[0] = U_INT8_Ta(l);
+ outblock[1] = U_INT8_Tb(l);
+ outblock[2] = U_INT8_Tc(l);
+ outblock[3] = U_INT8_Td(l);
+ outblock[4] = U_INT8_Ta(r);
+ outblock[5] = U_INT8_Tb(r);
+ outblock[6] = U_INT8_Tc(r);
+ outblock[7] = U_INT8_Td(r);
/* Wipe clean */
t = l = r = 0;
}
@@ -126,9 +126,9 @@ u32 t, l, r;
/***** Key Schedual *****/
-void cast_setkey(cast_key* key, u8* rawkey, int keybytes)
+void cast_setkey(cast_key* key, u_int8_t* rawkey, int keybytes)
{
-u32 t[4], z[4], x[4];
+u_int32_t t[4], z[4], x[4];
int i;
/* Set number of rounds to 12 or 16, depending on key length */
@@ -137,91 +137,91 @@ int i;
/* Copy key to workspace x */
for (i = 0; i < 4; i++) {
x[i] = 0;
- if ((i*4+0) < keybytes) x[i] = (u32)rawkey[i*4+0] << 24;
- if ((i*4+1) < keybytes) x[i] |= (u32)rawkey[i*4+1] << 16;
- if ((i*4+2) < keybytes) x[i] |= (u32)rawkey[i*4+2] << 8;
- if ((i*4+3) < keybytes) x[i] |= (u32)rawkey[i*4+3];
+ if ((i*4+0) < keybytes) x[i] = (u_int32_t)rawkey[i*4+0] << 24;
+ if ((i*4+1) < keybytes) x[i] |= (u_int32_t)rawkey[i*4+1] << 16;
+ if ((i*4+2) < keybytes) x[i] |= (u_int32_t)rawkey[i*4+2] << 8;
+ if ((i*4+3) < keybytes) x[i] |= (u_int32_t)rawkey[i*4+3];
}
/* Generate 32 subkeys, four at a time */
for (i = 0; i < 32; i+=4) {
switch (i & 4) {
case 0:
- t[0] = z[0] = x[0] ^ cast_sbox5[U8b(x[3])] ^
- cast_sbox6[U8d(x[3])] ^ cast_sbox7[U8a(x[3])] ^
- cast_sbox8[U8c(x[3])] ^ cast_sbox7[U8a(x[2])];
- t[1] = z[1] = x[2] ^ cast_sbox5[U8a(z[0])] ^
- cast_sbox6[U8c(z[0])] ^ cast_sbox7[U8b(z[0])] ^
- cast_sbox8[U8d(z[0])] ^ cast_sbox8[U8c(x[2])];
- t[2] = z[2] = x[3] ^ cast_sbox5[U8d(z[1])] ^
- cast_sbox6[U8c(z[1])] ^ cast_sbox7[U8b(z[1])] ^
- cast_sbox8[U8a(z[1])] ^ cast_sbox5[U8b(x[2])];
- t[3] = z[3] = x[1] ^ cast_sbox5[U8c(z[2])] ^
- cast_sbox6[U8b(z[2])] ^ cast_sbox7[U8d(z[2])] ^
- cast_sbox8[U8a(z[2])] ^ cast_sbox6[U8d(x[2])];
+ t[0] = z[0] = x[0] ^ cast_sbox5[U_INT8_Tb(x[3])] ^
+ cast_sbox6[U_INT8_Td(x[3])] ^ cast_sbox7[U_INT8_Ta(x[3])] ^
+ cast_sbox8[U_INT8_Tc(x[3])] ^ cast_sbox7[U_INT8_Ta(x[2])];
+ t[1] = z[1] = x[2] ^ cast_sbox5[U_INT8_Ta(z[0])] ^
+ cast_sbox6[U_INT8_Tc(z[0])] ^ cast_sbox7[U_INT8_Tb(z[0])] ^
+ cast_sbox8[U_INT8_Td(z[0])] ^ cast_sbox8[U_INT8_Tc(x[2])];
+ t[2] = z[2] = x[3] ^ cast_sbox5[U_INT8_Td(z[1])] ^
+ cast_sbox6[U_INT8_Tc(z[1])] ^ cast_sbox7[U_INT8_Tb(z[1])] ^
+ cast_sbox8[U_INT8_Ta(z[1])] ^ cast_sbox5[U_INT8_Tb(x[2])];
+ t[3] = z[3] = x[1] ^ cast_sbox5[U_INT8_Tc(z[2])] ^
+ cast_sbox6[U_INT8_Tb(z[2])] ^ cast_sbox7[U_INT8_Td(z[2])] ^
+ cast_sbox8[U_INT8_Ta(z[2])] ^ cast_sbox6[U_INT8_Td(x[2])];
break;
case 4:
- t[0] = x[0] = z[2] ^ cast_sbox5[U8b(z[1])] ^
- cast_sbox6[U8d(z[1])] ^ cast_sbox7[U8a(z[1])] ^
- cast_sbox8[U8c(z[1])] ^ cast_sbox7[U8a(z[0])];
- t[1] = x[1] = z[0] ^ cast_sbox5[U8a(x[0])] ^
- cast_sbox6[U8c(x[0])] ^ cast_sbox7[U8b(x[0])] ^
- cast_sbox8[U8d(x[0])] ^ cast_sbox8[U8c(z[0])];
- t[2] = x[2] = z[1] ^ cast_sbox5[U8d(x[1])] ^
- cast_sbox6[U8c(x[1])] ^ cast_sbox7[U8b(x[1])] ^
- cast_sbox8[U8a(x[1])] ^ cast_sbox5[U8b(z[0])];
- t[3] = x[3] = z[3] ^ cast_sbox5[U8c(x[2])] ^
- cast_sbox6[U8b(x[2])] ^ cast_sbox7[U8d(x[2])] ^
- cast_sbox8[U8a(x[2])] ^ cast_sbox6[U8d(z[0])];
+ t[0] = x[0] = z[2] ^ cast_sbox5[U_INT8_Tb(z[1])] ^
+ cast_sbox6[U_INT8_Td(z[1])] ^ cast_sbox7[U_INT8_Ta(z[1])] ^
+ cast_sbox8[U_INT8_Tc(z[1])] ^ cast_sbox7[U_INT8_Ta(z[0])];
+ t[1] = x[1] = z[0] ^ cast_sbox5[U_INT8_Ta(x[0])] ^
+ cast_sbox6[U_INT8_Tc(x[0])] ^ cast_sbox7[U_INT8_Tb(x[0])] ^
+ cast_sbox8[U_INT8_Td(x[0])] ^ cast_sbox8[U_INT8_Tc(z[0])];
+ t[2] = x[2] = z[1] ^ cast_sbox5[U_INT8_Td(x[1])] ^
+ cast_sbox6[U_INT8_Tc(x[1])] ^ cast_sbox7[U_INT8_Tb(x[1])] ^
+ cast_sbox8[U_INT8_Ta(x[1])] ^ cast_sbox5[U_INT8_Tb(z[0])];
+ t[3] = x[3] = z[3] ^ cast_sbox5[U_INT8_Tc(x[2])] ^
+ cast_sbox6[U_INT8_Tb(x[2])] ^ cast_sbox7[U_INT8_Td(x[2])] ^
+ cast_sbox8[U_INT8_Ta(x[2])] ^ cast_sbox6[U_INT8_Td(z[0])];
break;
}
switch (i & 12) {
case 0:
case 12:
- key->xkey[i+0] = cast_sbox5[U8a(t[2])] ^ cast_sbox6[U8b(t[2])] ^
- cast_sbox7[U8d(t[1])] ^ cast_sbox8[U8c(t[1])];
- key->xkey[i+1] = cast_sbox5[U8c(t[2])] ^ cast_sbox6[U8d(t[2])] ^
- cast_sbox7[U8b(t[1])] ^ cast_sbox8[U8a(t[1])];
- key->xkey[i+2] = cast_sbox5[U8a(t[3])] ^ cast_sbox6[U8b(t[3])] ^
- cast_sbox7[U8d(t[0])] ^ cast_sbox8[U8c(t[0])];
- key->xkey[i+3] = cast_sbox5[U8c(t[3])] ^ cast_sbox6[U8d(t[3])] ^
- cast_sbox7[U8b(t[0])] ^ cast_sbox8[U8a(t[0])];
+ key->xkey[i+0] = cast_sbox5[U_INT8_Ta(t[2])] ^ cast_sbox6[U_INT8_Tb(t[2])] ^
+ cast_sbox7[U_INT8_Td(t[1])] ^ cast_sbox8[U_INT8_Tc(t[1])];
+ key->xkey[i+1] = cast_sbox5[U_INT8_Tc(t[2])] ^ cast_sbox6[U_INT8_Td(t[2])] ^
+ cast_sbox7[U_INT8_Tb(t[1])] ^ cast_sbox8[U_INT8_Ta(t[1])];
+ key->xkey[i+2] = cast_sbox5[U_INT8_Ta(t[3])] ^ cast_sbox6[U_INT8_Tb(t[3])] ^
+ cast_sbox7[U_INT8_Td(t[0])] ^ cast_sbox8[U_INT8_Tc(t[0])];
+ key->xkey[i+3] = cast_sbox5[U_INT8_Tc(t[3])] ^ cast_sbox6[U_INT8_Td(t[3])] ^
+ cast_sbox7[U_INT8_Tb(t[0])] ^ cast_sbox8[U_INT8_Ta(t[0])];
break;
case 4:
case 8:
- key->xkey[i+0] = cast_sbox5[U8d(t[0])] ^ cast_sbox6[U8c(t[0])] ^
- cast_sbox7[U8a(t[3])] ^ cast_sbox8[U8b(t[3])];
- key->xkey[i+1] = cast_sbox5[U8b(t[0])] ^ cast_sbox6[U8a(t[0])] ^
- cast_sbox7[U8c(t[3])] ^ cast_sbox8[U8d(t[3])];
- key->xkey[i+2] = cast_sbox5[U8d(t[1])] ^ cast_sbox6[U8c(t[1])] ^
- cast_sbox7[U8a(t[2])] ^ cast_sbox8[U8b(t[2])];
- key->xkey[i+3] = cast_sbox5[U8b(t[1])] ^ cast_sbox6[U8a(t[1])] ^
- cast_sbox7[U8c(t[2])] ^ cast_sbox8[U8d(t[2])];
+ key->xkey[i+0] = cast_sbox5[U_INT8_Td(t[0])] ^ cast_sbox6[U_INT8_Tc(t[0])] ^
+ cast_sbox7[U_INT8_Ta(t[3])] ^ cast_sbox8[U_INT8_Tb(t[3])];
+ key->xkey[i+1] = cast_sbox5[U_INT8_Tb(t[0])] ^ cast_sbox6[U_INT8_Ta(t[0])] ^
+ cast_sbox7[U_INT8_Tc(t[3])] ^ cast_sbox8[U_INT8_Td(t[3])];
+ key->xkey[i+2] = cast_sbox5[U_INT8_Td(t[1])] ^ cast_sbox6[U_INT8_Tc(t[1])] ^
+ cast_sbox7[U_INT8_Ta(t[2])] ^ cast_sbox8[U_INT8_Tb(t[2])];
+ key->xkey[i+3] = cast_sbox5[U_INT8_Tb(t[1])] ^ cast_sbox6[U_INT8_Ta(t[1])] ^
+ cast_sbox7[U_INT8_Tc(t[2])] ^ cast_sbox8[U_INT8_Td(t[2])];
break;
}
switch (i & 12) {
case 0:
- key->xkey[i+0] ^= cast_sbox5[U8c(z[0])];
- key->xkey[i+1] ^= cast_sbox6[U8c(z[1])];
- key->xkey[i+2] ^= cast_sbox7[U8b(z[2])];
- key->xkey[i+3] ^= cast_sbox8[U8a(z[3])];
+ key->xkey[i+0] ^= cast_sbox5[U_INT8_Tc(z[0])];
+ key->xkey[i+1] ^= cast_sbox6[U_INT8_Tc(z[1])];
+ key->xkey[i+2] ^= cast_sbox7[U_INT8_Tb(z[2])];
+ key->xkey[i+3] ^= cast_sbox8[U_INT8_Ta(z[3])];
break;
case 4:
- key->xkey[i+0] ^= cast_sbox5[U8a(x[2])];
- key->xkey[i+1] ^= cast_sbox6[U8b(x[3])];
- key->xkey[i+2] ^= cast_sbox7[U8d(x[0])];
- key->xkey[i+3] ^= cast_sbox8[U8d(x[1])];
+ key->xkey[i+0] ^= cast_sbox5[U_INT8_Ta(x[2])];
+ key->xkey[i+1] ^= cast_sbox6[U_INT8_Tb(x[3])];
+ key->xkey[i+2] ^= cast_sbox7[U_INT8_Td(x[0])];
+ key->xkey[i+3] ^= cast_sbox8[U_INT8_Td(x[1])];
break;
case 8:
- key->xkey[i+0] ^= cast_sbox5[U8b(z[2])];
- key->xkey[i+1] ^= cast_sbox6[U8a(z[3])];
- key->xkey[i+2] ^= cast_sbox7[U8c(z[0])];
- key->xkey[i+3] ^= cast_sbox8[U8c(z[1])];
+ key->xkey[i+0] ^= cast_sbox5[U_INT8_Tb(z[2])];
+ key->xkey[i+1] ^= cast_sbox6[U_INT8_Ta(z[3])];
+ key->xkey[i+2] ^= cast_sbox7[U_INT8_Tc(z[0])];
+ key->xkey[i+3] ^= cast_sbox8[U_INT8_Tc(z[1])];
break;
case 12:
- key->xkey[i+0] ^= cast_sbox5[U8d(x[0])];
- key->xkey[i+1] ^= cast_sbox6[U8d(x[1])];
- key->xkey[i+2] ^= cast_sbox7[U8a(x[2])];
- key->xkey[i+3] ^= cast_sbox8[U8b(x[3])];
+ key->xkey[i+0] ^= cast_sbox5[U_INT8_Td(x[0])];
+ key->xkey[i+1] ^= cast_sbox6[U_INT8_Td(x[1])];
+ key->xkey[i+2] ^= cast_sbox7[U_INT8_Ta(x[2])];
+ key->xkey[i+3] ^= cast_sbox8[U_INT8_Tb(x[3])];
break;
}
if (i >= 16) {
diff --git a/sys/netinet/ip_cast.h b/sys/netinet/ip_cast.h
index ea50b5fe207..e0328affb56 100644
--- a/sys/netinet/ip_cast.h
+++ b/sys/netinet/ip_cast.h
@@ -1,4 +1,5 @@
-/* $OpenBSD: ip_cast.h,v 1.2 1998/11/24 10:04:06 niklas Exp $ */
+/* $OpenBSD: ip_cast.h,v 1.3 1999/02/17 18:09:55 deraadt Exp $ */
+
/*
* CAST-128 in C
* Written by Steve Reid <sreid@sea-to-sky.net>
@@ -9,17 +10,13 @@
#ifndef _CAST_H_
#define _CAST_H_
-typedef u_int8_t u8; /* 8-bit unsigned */
-typedef u_int32_t u32; /* 32-bit unsigned */
-
typedef struct {
- u32 xkey[32]; /* Key, after expansion */
- int rounds; /* Number of rounds to use, 12 or 16 */
+ u_int32_t xkey[32]; /* Key, after expansion */
+ int rounds; /* Number of rounds to use, 12 or 16 */
} cast_key;
-void cast_setkey(cast_key* key, u8* rawkey, int keybytes);
-void cast_encrypt(cast_key* key, u8* inblock, u8* outblock);
-void cast_decrypt(cast_key* key, u8* inblock, u8* outblock);
+void cast_setkey __P((cast_key * key, u_int8_t * rawkey, int keybytes));
+void cast_encrypt __P((cast_key * key, u_int8_t * inblock, u_int8_t * outblock));
+void cast_decrypt __P((cast_key * key, u_int8_t * inblock, u_int8_t * outblock));
#endif /* ifndef _CAST_H_ */
-
diff --git a/sys/netinet/ip_castsb.h b/sys/netinet/ip_castsb.h
index e4d51df8f82..4d5a73bb6b3 100644
--- a/sys/netinet/ip_castsb.h
+++ b/sys/netinet/ip_castsb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_castsb.h,v 1.1 1997/11/04 09:11:07 provos Exp $ */
+/* $OpenBSD: ip_castsb.h,v 1.2 1999/02/17 18:09:55 deraadt Exp $ */
/*
* CAST-128 in C
* Written by Steve Reid <sreid@sea-to-sky.net>
@@ -6,7 +6,7 @@
* Released 1997.10.11
*/
-static const u32 cast_sbox1[256] = {
+static const u_int32_t cast_sbox1[256] = {
0x30FB40D4, 0x9FA0FF0B, 0x6BECCD2F, 0x3F258C7A,
0x1E213F2F, 0x9C004DD3, 0x6003E540, 0xCF9FC949,
0xBFD4AF27, 0x88BBBDB5, 0xE2034090, 0x98D09675,
@@ -73,7 +73,7 @@ static const u32 cast_sbox1[256] = {
0x427B169C, 0x5AC9F049, 0xDD8F0F00, 0x5C8165BF
};
-static const u32 cast_sbox2[256] = {
+static const u_int32_t cast_sbox2[256] = {
0x1F201094, 0xEF0BA75B, 0x69E3CF7E, 0x393F4380,
0xFE61CF7A, 0xEEC5207A, 0x55889C94, 0x72FC0651,
0xADA7EF79, 0x4E1D7235, 0xD55A63CE, 0xDE0436BA,
@@ -140,7 +140,7 @@ static const u32 cast_sbox2[256] = {
0x7160A539, 0x73BFBE70, 0x83877605, 0x4523ECF1
};
-static const u32 cast_sbox3[256] = {
+static const u_int32_t cast_sbox3[256] = {
0x8DEFC240, 0x25FA5D9F, 0xEB903DBF, 0xE810C907,
0x47607FFF, 0x369FE44B, 0x8C1FC644, 0xAECECA90,
0xBEB1F9BF, 0xEEFBCAEA, 0xE8CF1950, 0x51DF07AE,
@@ -207,7 +207,7 @@ static const u32 cast_sbox3[256] = {
0xDFEF4636, 0xA133C501, 0xE9D3531C, 0xEE353783
};
-static const u32 cast_sbox4[256] = {
+static const u_int32_t cast_sbox4[256] = {
0x9DB30420, 0x1FB6E9DE, 0xA7BE7BEF, 0xD273A298,
0x4A4F7BDB, 0x64AD8C57, 0x85510443, 0xFA020ED1,
0x7E287AFF, 0xE60FB663, 0x095F35A1, 0x79EBF120,
@@ -274,7 +274,7 @@ static const u32 cast_sbox4[256] = {
0x13ECF0B0, 0xD3FFB372, 0x3F85C5C1, 0x0AEF7ED2
};
-static const u32 cast_sbox5[256] = {
+static const u_int32_t cast_sbox5[256] = {
0x7EC90C04, 0x2C6E74B9, 0x9B0E66DF, 0xA6337911,
0xB86A7FFF, 0x1DD358F5, 0x44DD9D44, 0x1731167F,
0x08FBF1FA, 0xE7F511CC, 0xD2051B00, 0x735ABA00,
@@ -341,7 +341,7 @@ static const u32 cast_sbox5[256] = {
0x5E76FFA8, 0xB1534546, 0x6D47DE08, 0xEFE9E7D4
};
-static const u32 cast_sbox6[256] = {
+static const u_int32_t cast_sbox6[256] = {
0xF6FA8F9D, 0x2CAC6CE1, 0x4CA34867, 0xE2337F7C,
0x95DB08E7, 0x016843B4, 0xECED5CBC, 0x325553AC,
0xBF9F0960, 0xDFA1E2ED, 0x83F0579D, 0x63ED86B9,
@@ -408,7 +408,7 @@ static const u32 cast_sbox6[256] = {
0x48392905, 0xA65B1DB8, 0x851C97BD, 0xD675CF2F
};
-static const u32 cast_sbox7[256] = {
+static const u_int32_t cast_sbox7[256] = {
0x85E04019, 0x332BF567, 0x662DBFFF, 0xCFC65693,
0x2A8D7F6F, 0xAB9BC912, 0xDE6008A1, 0x2028DA1F,
0x0227BCE7, 0x4D642916, 0x18FAC300, 0x50F18B82,
@@ -475,7 +475,7 @@ static const u32 cast_sbox7[256] = {
0xF2A279C7, 0x94E01BE8, 0x90716F4B, 0x954B8AA3
};
-static const u32 cast_sbox8[256] = {
+static const u_int32_t cast_sbox8[256] = {
0xE216300D, 0xBBDDFFFC, 0xA7EBDABD, 0x35648095,
0x7789F8B7, 0xE6C1121B, 0x0E241600, 0x052CE8B5,
0x11A9CFB0, 0xE5952F11, 0xECE7990A, 0x9386D174,