aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorMati Vait <mativait@gmail.com>2011-06-08 09:26:00 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2011-06-29 19:44:05 -0400
commitcfa2b54eca28103d07e5334aa06b78321fbe1d9a (patch)
tree2c992efc775674cf47c8d89b736a54d8e30b4627 /crypto
parentfae366401bfcfe18b9260b9057f506c38c171b7c (diff)
crypto: arc4 - Fixed coding style issues
Fixed coding style issues: unnecessary spaces, parentheses on wrong lines. Signed-off-by: Mati Vait <mativait@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/arc4.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/crypto/arc4.c b/crypto/arc4.c
index 8be47e13a9e..0d12a96da1d 100644
--- a/crypto/arc4.c
+++ b/crypto/arc4.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Cryptographic API 2 * Cryptographic API
3 * 3 *
4 * ARC4 Cipher Algorithm 4 * ARC4 Cipher Algorithm
@@ -33,16 +33,15 @@ static int arc4_set_key(struct crypto_tfm *tfm, const u8 *in_key,
33 ctx->x = 1; 33 ctx->x = 1;
34 ctx->y = 0; 34 ctx->y = 0;
35 35
36 for(i = 0; i < 256; i++) 36 for (i = 0; i < 256; i++)
37 ctx->S[i] = i; 37 ctx->S[i] = i;
38 38
39 for(i = 0; i < 256; i++) 39 for (i = 0; i < 256; i++) {
40 {
41 u8 a = ctx->S[i]; 40 u8 a = ctx->S[i];
42 j = (j + in_key[k] + a) & 0xff; 41 j = (j + in_key[k] + a) & 0xff;
43 ctx->S[i] = ctx->S[j]; 42 ctx->S[i] = ctx->S[j];
44 ctx->S[j] = a; 43 ctx->S[j] = a;
45 if(++k >= key_len) 44 if (++k >= key_len)
46 k = 0; 45 k = 0;
47 } 46 }
48 47
@@ -80,9 +79,9 @@ static struct crypto_alg arc4_alg = {
80 .cra_u = { .cipher = { 79 .cra_u = { .cipher = {
81 .cia_min_keysize = ARC4_MIN_KEY_SIZE, 80 .cia_min_keysize = ARC4_MIN_KEY_SIZE,
82 .cia_max_keysize = ARC4_MAX_KEY_SIZE, 81 .cia_max_keysize = ARC4_MAX_KEY_SIZE,
83 .cia_setkey = arc4_set_key, 82 .cia_setkey = arc4_set_key,
84 .cia_encrypt = arc4_crypt, 83 .cia_encrypt = arc4_crypt,
85 .cia_decrypt = arc4_crypt } } 84 .cia_decrypt = arc4_crypt } }
86}; 85};
87 86
88static int __init arc4_init(void) 87static int __init arc4_init(void)