balaji2u
New Member
- Messages
- 410
- Reaction score
- 2
- Points
- 0
Any one of you guys predict what this code is ..
Let me give a clue this is actually used as a trade secrete and then due to its superior features its used as a "________"
If you dont know the answer see this page
Answer
Let me give a clue this is actually used as a trade secrete and then due to its superior features its used as a "________"
Code:
typedef unsigned char uns8;
typedef unsigned char uns16;
static uns8 state[256],x,y;
void thisquestionsanswer_lol (key,length)
uns8 *key;
uns16 length;
{
int i;
uns8 t;
uns8 j;
uns8 k=0;
for (i=256;i--;) //indefinite loop did you got the answer?
state [i]=i;
for(i=0,j=0,i<256;i++,j=(j+1)%length)
t=state[i],state[i]=state[k+=key[j]+t],state[k]=t;
x=0;
y=0;
}
uns8 answer_step_lol()
{
uns8 t;
t=state[y+=state[++x]],state[y]=state[x],state[x]=t;
return (state[state[statex]+state[y]]);
}
Answer