提交 0d8fb0a1 编写于 作者: R Richard Hartmann 提交者: Herbert Xu

crypto: blowfish - Fix checkpatch errors

Signed-off-by: NRichard Hartmann <richih.mailinglist@gmail.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 3922538f
/* /*
* Cryptographic API. * Cryptographic API.
* *
* Blowfish Cipher Algorithm, by Bruce Schneier. * Blowfish Cipher Algorithm, by Bruce Schneier.
...@@ -299,7 +299,7 @@ static const u32 bf_sbox[256 * 4] = { ...@@ -299,7 +299,7 @@ static const u32 bf_sbox[256 * 4] = {
0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6,
}; };
/* /*
* Round loop unrolling macros, S is a pointer to a S-Box array * Round loop unrolling macros, S is a pointer to a S-Box array
* organized in 4 unsigned longs at a row. * organized in 4 unsigned longs at a row.
*/ */
...@@ -315,7 +315,7 @@ static const u32 bf_sbox[256 * 4] = { ...@@ -315,7 +315,7 @@ static const u32 bf_sbox[256 * 4] = {
/* /*
* The blowfish encipher, processes 64-bit blocks. * 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) static void encrypt_block(struct bf_ctx *bctx, u32 *dst, u32 *src)
{ {
...@@ -395,7 +395,7 @@ static void bf_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) ...@@ -395,7 +395,7 @@ static void bf_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
out_blk[1] = cpu_to_be32(yl); out_blk[1] = cpu_to_be32(yl);
} }
/* /*
* Calculates the blowfish S and P boxes for encryption and decryption. * 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) 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,10 +417,10 @@ static int bf_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
/* Actual subkey generation */ /* Actual subkey generation */
for (j = 0, i = 0; i < 16 + 2; i++) { for (j = 0, i = 0; i < 16 + 2; i++) {
temp = (((u32 )key[j] << 24) | temp = (((u32)key[j] << 24) |
((u32 )key[(j + 1) % keylen] << 16) | ((u32)key[(j + 1) % keylen] << 16) |
((u32 )key[(j + 2) % keylen] << 8) | ((u32)key[(j + 2) % keylen] << 8) |
((u32 )key[(j + 3) % keylen])); ((u32)key[(j + 3) % keylen]));
P[i] = P[i] ^ temp; P[i] = P[i] ^ temp;
j = (j + 4) % keylen; j = (j + 4) % keylen;
...@@ -444,7 +444,7 @@ static int bf_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) ...@@ -444,7 +444,7 @@ static int bf_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
S[count + 1] = data[1]; S[count + 1] = data[1];
} }
} }
/* Bruce says not to bother with the weak key check. */ /* Bruce says not to bother with the weak key check. */
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册