diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-26 19:50:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-26 19:50:02 -0500 |
commit | 37d4008484977f60d5d37499a2670c79b214dd46 (patch) | |
tree | e73ef4b7c3eee1543e13d7be2ecb1593e77eb123 /crypto/blowfish.c | |
parent | 68c6b859846bd078b37c6ca5f3882032f129e72d (diff) | |
parent | 8d0c123f8b710561cfd34f6e1a5bebc27988edbe (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (31 commits)
crypto: aes_generic - Fix checkpatch errors
crypto: fcrypt - Fix checkpatch errors
crypto: ecb - Fix checkpatch errors
crypto: des_generic - Fix checkpatch errors
crypto: deflate - Fix checkpatch errors
crypto: crypto_null - Fix checkpatch errors
crypto: cipher - Fix checkpatch errors
crypto: crc32 - Fix checkpatch errors
crypto: compress - Fix checkpatch errors
crypto: cast6 - Fix checkpatch errors
crypto: cast5 - Fix checkpatch errors
crypto: camellia - Fix checkpatch errors
crypto: authenc - Fix checkpatch errors
crypto: api - Fix checkpatch errors
crypto: anubis - Fix checkpatch errors
crypto: algapi - Fix checkpatch errors
crypto: blowfish - Fix checkpatch errors
crypto: aead - Fix checkpatch errors
crypto: ablkcipher - Fix checkpatch errors
crypto: pcrypt - call the complete function on error
...
Diffstat (limited to 'crypto/blowfish.c')
-rw-r--r-- | crypto/blowfish.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crypto/blowfish.c b/crypto/blowfish.c index 6f5b48731922..a67d52ee0580 100644 --- a/crypto/blowfish.c +++ b/crypto/blowfish.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Cryptographic API. | 2 | * Cryptographic API. |
3 | * | 3 | * |
4 | * Blowfish Cipher Algorithm, by Bruce Schneier. | 4 | * Blowfish Cipher Algorithm, by Bruce Schneier. |
@@ -299,7 +299,7 @@ static const u32 bf_sbox[256 * 4] = { | |||
299 | 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, | 299 | 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, |
300 | }; | 300 | }; |
301 | 301 | ||
302 | /* | 302 | /* |
303 | * Round loop unrolling macros, S is a pointer to a S-Box array | 303 | * Round loop unrolling macros, S is a pointer to a S-Box array |
304 | * organized in 4 unsigned longs at a row. | 304 | * organized in 4 unsigned longs at a row. |
305 | */ | 305 | */ |
@@ -315,7 +315,7 @@ static const u32 bf_sbox[256 * 4] = { | |||
315 | 315 | ||
316 | /* | 316 | /* |
317 | * The blowfish encipher, processes 64-bit blocks. | 317 | * The blowfish encipher, processes 64-bit blocks. |
318 | * NOTE: This function MUSTN'T respect endianess | 318 | * NOTE: This function MUSTN'T respect endianess |
319 | */ | 319 | */ |
320 | static void encrypt_block(struct bf_ctx *bctx, u32 *dst, u32 *src) | 320 | static void encrypt_block(struct bf_ctx *bctx, u32 *dst, u32 *src) |
321 | { | 321 | { |
@@ -395,7 +395,7 @@ static void bf_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) | |||
395 | out_blk[1] = cpu_to_be32(yl); | 395 | out_blk[1] = cpu_to_be32(yl); |
396 | } | 396 | } |
397 | 397 | ||
398 | /* | 398 | /* |
399 | * Calculates the blowfish S and P boxes for encryption and decryption. | 399 | * Calculates the blowfish S and P boxes for encryption and decryption. |
400 | */ | 400 | */ |
401 | static int bf_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) | 401 | static int bf_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) |
@@ -417,10 +417,10 @@ static int bf_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) | |||
417 | 417 | ||
418 | /* Actual subkey generation */ | 418 | /* Actual subkey generation */ |
419 | for (j = 0, i = 0; i < 16 + 2; i++) { | 419 | for (j = 0, i = 0; i < 16 + 2; i++) { |
420 | temp = (((u32 )key[j] << 24) | | 420 | temp = (((u32)key[j] << 24) | |
421 | ((u32 )key[(j + 1) % keylen] << 16) | | 421 | ((u32)key[(j + 1) % keylen] << 16) | |
422 | ((u32 )key[(j + 2) % keylen] << 8) | | 422 | ((u32)key[(j + 2) % keylen] << 8) | |
423 | ((u32 )key[(j + 3) % keylen])); | 423 | ((u32)key[(j + 3) % keylen])); |
424 | 424 | ||
425 | P[i] = P[i] ^ temp; | 425 | P[i] = P[i] ^ temp; |
426 | j = (j + 4) % keylen; | 426 | j = (j + 4) % keylen; |
@@ -444,7 +444,7 @@ static int bf_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) | |||
444 | S[count + 1] = data[1]; | 444 | S[count + 1] = data[1]; |
445 | } | 445 | } |
446 | } | 446 | } |
447 | 447 | ||
448 | /* Bruce says not to bother with the weak key check. */ | 448 | /* Bruce says not to bother with the weak key check. */ |
449 | return 0; | 449 | return 0; |
450 | } | 450 | } |