[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: arcfour
From: |
Bruno Haible |
Subject: |
Re: arcfour |
Date: |
Fri, 14 Oct 2005 20:47:39 +0200 |
User-agent: |
KMail/1.5 |
Paul Eggert wrote:
> > +#define ARCFOUR_SBOX_SIZE 256
> > +
> > +typedef struct
> > +{
> > + size_t idx_i, idx_j;
> > + char sbox[ARCFOUR_SBOX_SIZE];
> > +} arcfour_context;
>
> Why must these be in arcfour.h? Shouldn't all this private to
> arcfour.c?
>
> You can replace the above lines with 'struct arcfour_context;' and
> then move them into arcfour.c (replacing 'arcfour_context' with
> 'struct arcfour_context' everywhere).
It is needed in arcfour.h so that the user of this module can allocate
a variable of type 'arcfour_context' on the stack. Or if the struct
contents is made private, at least sizeof(arcfour_context) must be made
available through a variable 'const size_t arcfour_context_size'; but
then the allocation of such a context on the stack needs alloca().
Bruno
- Re: arcfour, (continued)
- Re: arcfour, Ralf Wildenhues, 2005/10/14
- Re: arcfour, Simon Josefsson, 2005/10/14
- Re: arcfour, Simon Josefsson, 2005/10/14
- Re: arcfour, Stepan Kasal, 2005/10/14
- Re: arcfour, Simon Josefsson, 2005/10/14
- Re: arcfour, Paul Eggert, 2005/10/14
- Re: arcfour,
Bruno Haible <=
- Re: arcfour, Simon Josefsson, 2005/10/14
- Re: arcfour, Paul Eggert, 2005/10/14
- Re: arcfour, Simon Josefsson, 2005/10/15
- Re: arcfour, Stepan Kasal, 2005/10/14
Re: [bug-gnulib] arcfour, Bruno Haible, 2005/10/14