bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: arcfour


From: Stepan Kasal
Subject: Re: arcfour
Date: Fri, 14 Oct 2005 16:47:22 +0200
User-agent: Mutt/1.4.1i

Hello,

On Fri, Oct 14, 2005 at 04:14:09PM +0200, Simon Josefsson wrote:
> Internally, in arcfour.c, [...]
> #define ARCFOUR_MOD_MASK (ARCFOUR_SBOX_SIZE - 1)

yes, this is a good idea, and it also applies to the proposal I have
just posted:

These two would be in .h:
    #define ARCFOUR_LOGSZ 8  /* or ARCFOUR_BLOCK_BITS */
    #define ARCFOUR_SIZE (1 << ARCFOUR_LOGSZ)

while this would be in .c
    /* Some compilers may not be able to optimize n % ARCFOUR_SIZE properly. */
    #define ARCFOUR_MODULO(n) ((n) & (ARCFOUR_SIZE - 1))

Regarding the ARCFOUR_SIZE alias ARCFOUR_SBOX_SIZE:
Perhaps we could call it ARCFOUR_BASE: all arithmetics is done modulo this
number.  The fact that this is also the size of the domain of the
permutation (sbox) is just a consequence.

Have a nice day,
        Stepan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]