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


_______________________________________________
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to