Previously it was interpreted as number of bytes, while the
documentation stated that it was the number of 8 byte blocks.
This makes it behave similarly to the existing AES code.
Signed-off-by: Martin Storsjö <martin@martin.st>
int i;
if (decrypt) {
- while (count > 0) {
+ while (count--) {
xtea_crypt_ecb(ctx, dst, src, decrypt);
if (iv) {
src += 8;
dst += 8;
- count -= 8;
}
} else {
- while (count > 0) {
+ while (count--) {
if (iv) {
for (i = 0; i < 8; i++)
dst[i] = src[i] ^ iv[i];
}
src += 8;
dst += 8;
- count -= 8;
}
}
}