First thing I suggest you do is turn up the warning level on your compiler to maximum, because there seems to be an awful lot of implicit casting going on.
> UINT16 ARCFOUR_Sbox;
This I'm guessing is an integal type, say something like
typedef unsigned short int UINT16;
> ARCFOUR_Sbox = &ARCFOUR_state[4];
This results in an IMPLICIT conversion of a pointer to a struct, to an unsigned short int
> ((arcfour_state *)(ARCFOUR_cntxt.state.ptr))->part0.ptr = ARCFOUR_Sbox;
This results in an IMPLICIT conversion of an unsigned short int to a pointer.
I'm guessing
typedef void * pointer32;
> &ARCFOUR_Sbox[64]; /*This line gives error*/
Yeah, ARCFOUR_Sbox is of an integral type, so its no surprise that you can't subscript it.
Well you could change the declaration to this
UINT16 *ARCFOUR_Sbox;
which would fix the immediately apparent problems with the code you posted, but I rather suspect there are wider issues at stake.
Like for instance, having done this
> &ARCFOUR_Sbox[64];
do you know that part1.ptr is 128 bytes past part0.ptr?
In your first post, you said
> UINT16 ARCFOUR_Sbox[256];
So what gives?
Posting accurate information really helps you know.
--