aboutsummaryrefslogtreecommitdiffstats
path: root/cipher/rijndael.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-05-24 18:31:33 +0000
committerDavid Shaw <[email protected]>2003-05-24 18:31:33 +0000
commit29e6411a7bc1657fab1a3c2b847051a30e2247ea (patch)
tree62aeaf6d2fb67efd3023169a6d82b085a70c3100 /cipher/rijndael.c
parent* mpicoder.c, mpi-inline.h, mpi-inv.c, mpiutil.c, mpih-div.c, (diff)
downloadgnupg-29e6411a7bc1657fab1a3c2b847051a30e2247ea.tar.gz
gnupg-29e6411a7bc1657fab1a3c2b847051a30e2247ea.zip
* bithelp.h, des.c, random.c, rndlinux.c, sha1.c, blowfish.c, elgamal.c,
rijndael.c, rndunix.c, sha256.c, cast5.c, idea-stub.c, rmd160.c, rndw32.c, sha512.c, md5.c, rmd160test.c, rsa.c, tiger.c: Edit all preprocessor instructions to remove whitespace before the '#'. This is not required by C89, but there are some compilers out there that don't like it.
Diffstat (limited to 'cipher/rijndael.c')
-rw-r--r--cipher/rijndael.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/cipher/rijndael.c b/cipher/rijndael.c
index a30cd5fee..c9eecbe95 100644
--- a/cipher/rijndael.c
+++ b/cipher/rijndael.c
@@ -1764,7 +1764,7 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
for (i = 0; i < keylen; i++) {
k[i >> 2][i & 3] = key[i];
}
- #define W (ctx->keySched)
+#define W (ctx->keySched)
for (j = KC-1; j >= 0; j--) {
*((u32*)tk[j]) = *((u32*)k[j]);
@@ -1819,7 +1819,7 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
}
}
- #undef W
+#undef W
return 0;
}
@@ -1844,7 +1844,7 @@ prepare_decryption( RIJNDAEL_context *ctx )
*((u32*)ctx->keySched2[r][2]) = *((u32*)ctx->keySched[r][2]);
*((u32*)ctx->keySched2[r][3]) = *((u32*)ctx->keySched[r][3]);
}
- #define W (ctx->keySched2)
+#define W (ctx->keySched2)
for (r = 1; r < ctx->ROUNDS; r++) {
w = W[r][0];
*((u32*)w) = *((u32*)U1[w[0]]) ^ *((u32*)U2[w[1]])
@@ -1862,7 +1862,7 @@ prepare_decryption( RIJNDAEL_context *ctx )
*((u32*)w) = *((u32*)U1[w[0]]) ^ *((u32*)U2[w[1]])
^ *((u32*)U3[w[2]]) ^ *((u32*)U4[w[3]]);
}
- #undef W
+#undef W
}
@@ -1874,7 +1874,7 @@ do_encrypt (const RIJNDAEL_context *ctx, byte *b, const byte *a)
int r;
byte temp[4][4];
int ROUNDS = ctx->ROUNDS;
- #define rk (ctx->keySched)
+#define rk (ctx->keySched)
*((u32*)temp[0]) = *((u32*)(a )) ^ *((u32*)rk[0][0]);
*((u32*)temp[1]) = *((u32*)(a+ 4)) ^ *((u32*)rk[0][1]);
@@ -1944,7 +1944,7 @@ do_encrypt (const RIJNDAEL_context *ctx, byte *b, const byte *a)
*((u32*)(b+ 4)) ^= *((u32*)rk[ROUNDS][1]);
*((u32*)(b+ 8)) ^= *((u32*)rk[ROUNDS][2]);
*((u32*)(b+12)) ^= *((u32*)rk[ROUNDS][3]);
- #undef rk
+#undef rk
}
static void
@@ -1959,7 +1959,7 @@ rijndael_encrypt (const RIJNDAEL_context *ctx, byte *b, const byte *a)
static void
do_decrypt (RIJNDAEL_context *ctx, byte *b, const byte *a)
{
- #define rk (ctx->keySched2)
+#define rk (ctx->keySched2)
int ROUNDS = ctx->ROUNDS;
int r;
byte temp[4][4];
@@ -2038,7 +2038,7 @@ do_decrypt (RIJNDAEL_context *ctx, byte *b, const byte *a)
*((u32*)(b+ 4)) ^= *((u32*)rk[0][1]);
*((u32*)(b+ 8)) ^= *((u32*)rk[0][2]);
*((u32*)(b+12)) ^= *((u32*)rk[0][3]);
- #undef rk
+#undef rk
}
static void
@@ -2223,12 +2223,3 @@ gnupgext_enum_func ( int what, int *sequence, int *class, int *vers )
return ret;
}
#endif
-
-
-
-
-
-
-
-
-