lkml.org 
[lkml]   [2004]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Linux 2.4.26-pre2
Marcelo Tosatti wrote:
>
> Hi,
>
> Here goes -pre2 -- it contains networking updates, network drivers
> updates, an XFS update, amongst others.
>
> <jon:focalhost.com>:
> o [CRYPTO]: Add ARC4 module

In standard C we declare all variables at the top of a function. While
some compilers allow extension, it is not a good idea to get used to
them if we want portable code.

If fails for me on Debian/stable.

Attached is a trivial patch for crypto/arc4.c.

--
Eyal Lebedinsky (eyal@eyal.emu.id.au) <http://samba.org/eyal/>
--- linux/crypto/arc4.c.orig Sun Mar 7 16:33:11 2004
+++ linux/crypto/arc4.c Sun Mar 7 16:35:12 2004
@@ -55,14 +55,14 @@
static void arc4_crypt(void *ctx_arg, u8 *out, const u8 *in)
{
struct arc4_ctx *ctx = ctx_arg;
+ u8 *const S, x, y, a, b;

- u8 *const S = ctx->S;
- u8 x = ctx->x;
- u8 y = ctx->y;
-
- u8 a = S[x];
+ S = ctx->S;
+ x = ctx->x;
+ y = ctx->y;
+ a = S[x];
y = (y + a) & 0xff;
- u8 b = S[y];
+ b = S[y];
S[x] = b;
S[y] = a;
x = (x + 1) & 0xff;
\
 
 \ /
  Last update: 2005-03-22 14:01    [W:0.089 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site