X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=blobdiff_plain;f=crypto%2Fblowfish.c;h=a67d52ee05800cd5ade61ab0b1fc6d3c8c435b0c;hp=55238c4e37f039c59872d5b049707a41cebc5160;hb=b2e75eff5e859d0c294e7405958362b26a423c6e;hpb=560c06ae1ab7c677002ea3b6ac83521bf12ee07d diff --git a/crypto/blowfish.c b/crypto/blowfish.c index 55238c4..a67d52e 100644 --- a/crypto/blowfish.c +++ b/crypto/blowfish.c @@ -1,4 +1,4 @@ -/* +/* * Cryptographic API. * * Blowfish Cipher Algorithm, by Bruce Schneier. @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -300,7 +299,7 @@ static const u32 bf_sbox[256 * 4] = { 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, }; -/* +/* * Round loop unrolling macros, S is a pointer to a S-Box array * organized in 4 unsigned longs at a row. */ @@ -316,7 +315,7 @@ static const u32 bf_sbox[256 * 4] = { /* * The blowfish encipher, processes 64-bit blocks. - * NOTE: This function MUSTN'T respect endianess + * NOTE: This function MUSTN'T respect endianess */ static void encrypt_block(struct bf_ctx *bctx, u32 *dst, u32 *src) { @@ -396,7 +395,7 @@ static void bf_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) out_blk[1] = cpu_to_be32(yl); } -/* +/* * Calculates the blowfish S and P boxes for encryption and decryption. */ static int bf_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) @@ -418,10 +417,10 @@ static int bf_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) /* Actual subkey generation */ for (j = 0, i = 0; i < 16 + 2; i++) { - temp = (((u32 )key[j] << 24) | - ((u32 )key[(j + 1) % keylen] << 16) | - ((u32 )key[(j + 2) % keylen] << 8) | - ((u32 )key[(j + 3) % keylen])); + temp = (((u32)key[j] << 24) | + ((u32)key[(j + 1) % keylen] << 16) | + ((u32)key[(j + 2) % keylen] << 8) | + ((u32)key[(j + 3) % keylen])); P[i] = P[i] ^ temp; j = (j + 4) % keylen; @@ -445,7 +444,7 @@ static int bf_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) S[count + 1] = data[1]; } } - + /* Bruce says not to bother with the weak key check. */ return 0; } @@ -466,18 +465,18 @@ static struct crypto_alg alg = { .cia_decrypt = bf_decrypt } } }; -static int __init init(void) +static int __init blowfish_mod_init(void) { return crypto_register_alg(&alg); } -static void __exit fini(void) +static void __exit blowfish_mod_fini(void) { crypto_unregister_alg(&alg); } -module_init(init); -module_exit(fini); +module_init(blowfish_mod_init); +module_exit(blowfish_mod_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Blowfish Cipher Algorithm");