Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / crypto / blowfish.c
index 83d5755..7f710b2 100644 (file)
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/mm.h>
+#include <asm/byteorder.h>
 #include <asm/scatterlist.h>
 #include <linux/crypto.h>
+#include <linux/types.h>
 
 #define BF_BLOCK_SIZE 8
 #define BF_MIN_KEY_SIZE 4
@@ -349,8 +351,8 @@ static void encrypt_block(struct bf_ctx *bctx, u32 *dst, u32 *src)
 
 static void bf_encrypt(void *ctx, u8 *dst, const u8 *src)
 {
-       const u32 *in_blk = (const u32 *)src;
-       u32 *const out_blk = (u32 *)dst;
+       const __be32 *in_blk = (const __be32 *)src;
+       __be32 *const out_blk = (__be32 *)dst;
        u32 in32[2], out32[2];
 
        in32[0] = be32_to_cpu(in_blk[0]);
@@ -362,8 +364,8 @@ static void bf_encrypt(void *ctx, u8 *dst, const u8 *src)
 
 static void bf_decrypt(void *ctx, u8 *dst, const u8 *src)
 {
-       const u32 *in_blk = (const u32 *)src;
-       u32 *const out_blk = (u32 *)dst;
+       const __be32 *in_blk = (const __be32 *)src;
+       __be32 *const out_blk = (__be32 *)dst;
        const u32 *P = ((struct bf_ctx *)ctx)->p;
        const u32 *S = ((struct bf_ctx *)ctx)->s;
        u32 yl = be32_to_cpu(in_blk[0]);
@@ -451,6 +453,7 @@ static struct crypto_alg alg = {
        .cra_flags              =       CRYPTO_ALG_TYPE_CIPHER,
        .cra_blocksize          =       BF_BLOCK_SIZE,
        .cra_ctxsize            =       sizeof(struct bf_ctx),
+       .cra_alignmask          =       3,
        .cra_module             =       THIS_MODULE,
        .cra_list               =       LIST_HEAD_INIT(alg.cra_list),
        .cra_u                  =       { .cipher = {