Messages in this thread Patch in this message | | | Date | Sun, 07 Mar 2004 16:44:39 +1100 | From | Eyal Lebedinsky <> | Subject | Re: 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; | |