I'm trying to work with Tiny Encryption Algorithm, but here is the thing: I'm not getting why the array is a long type and it has hex values, for example,
unsigned long v[] = {0xe15034c8, 0x260fd6d5};
Also, I want to pass a plaintext (ASCII) read from stream, in what data format should I pass it to this type of array?
the encryption function is:
void encipher(unsigned long *const v,unsigned long *const w,
const unsigned long *const k)
{
register unsigned long y=v[0],z=v[1],sum=0,delta=0x9E3779B9,
a=k[0],b=k[1],c=k[2],d=k[3],n=32;
while(n-->0)
{
sum += delta;
y += (z << 4)+a ^ z+sum ^ (z >> 5)+b;
z += (y << 4)+c ^ y+sum ^ (y >> 5)+d;
}
w[0]=y; w[1]=z;
}