Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257930
b: refs/heads/master
c: cfa2b54
h: refs/heads/master
v: v3
  • Loading branch information
Mati Vait authored and Herbert Xu committed Jun 29, 2011
1 parent 3c71e72 commit 26df630
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fae366401bfcfe18b9260b9057f506c38c171b7c
refs/heads/master: cfa2b54eca28103d07e5334aa06b78321fbe1d9a
15 changes: 7 additions & 8 deletions trunk/crypto/arc4.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Cryptographic API
*
* ARC4 Cipher Algorithm
Expand Down Expand Up @@ -33,16 +33,15 @@ static int arc4_set_key(struct crypto_tfm *tfm, const u8 *in_key,
ctx->x = 1;
ctx->y = 0;

for(i = 0; i < 256; i++)
for (i = 0; i < 256; i++)
ctx->S[i] = i;

for(i = 0; i < 256; i++)
{
for (i = 0; i < 256; i++) {
u8 a = ctx->S[i];
j = (j + in_key[k] + a) & 0xff;
ctx->S[i] = ctx->S[j];
ctx->S[j] = a;
if(++k >= key_len)
if (++k >= key_len)
k = 0;
}

Expand Down Expand Up @@ -80,9 +79,9 @@ static struct crypto_alg arc4_alg = {
.cra_u = { .cipher = {
.cia_min_keysize = ARC4_MIN_KEY_SIZE,
.cia_max_keysize = ARC4_MAX_KEY_SIZE,
.cia_setkey = arc4_set_key,
.cia_encrypt = arc4_crypt,
.cia_decrypt = arc4_crypt } }
.cia_setkey = arc4_set_key,
.cia_encrypt = arc4_crypt,
.cia_decrypt = arc4_crypt } }
};

static int __init arc4_init(void)
Expand Down

0 comments on commit 26df630

Please sign in to comment.