void encrypt (unsigned long* v, unsigned long* k) {
unsigned long v0=v[0], v1=v[1], sum=0, i; /* set up */
unsigned long delta=0x9e3779b9; /* a key schedule constant */
unsigned long k0=k[0], k1=k[1], k2=k[2], k3=k[3]; /* cache key */
for (i=0; i < 32; i++) { /* basic cycle start */
sum += delta;
v0 += ((v1<<4) + k0) ^ (v1 + sum) ^ ((v1>>5) + k1);
v1 += ((v0<<4) + k2) ^ (v0 + sum) ^ ((v0>>5) + k3);
} /* end cycle */
v[0]=v0; v[1]=v1;
}
I saw this code on the wiki of TEA encryption and was wondering is this considered a 4-bit or 5-bit algorithm since there was a shift of 4 bits to the left but a shift of 5 bit to the right.
I am confused on the algorithm of this encryption and would appreciate it if somebody can clarify it for me.
Thank you