Should slightly improve performance depending on the compiler used.
{
int i;
- while (count > 0) {
- if (decrypt) {
+ if (decrypt) {
+ while (count > 0) {
xtea_crypt_ecb(ctx, dst, src, decrypt);
if (iv) {
dst[i] = dst[i] ^ iv[i];
memcpy(iv, src, 8);
}
- } else {
+
+ src += 8;
+ dst += 8;
+ count -= 8;
+ }
+ } else {
+ while (count > 0) {
if (iv) {
for (i = 0; i < 8; i++)
dst[i] = src[i] ^ iv[i];
} else {
xtea_crypt_ecb(ctx, dst, src, decrypt);
}
+ src += 8;
+ dst += 8;
+ count -= 8;
}
-
- src += 8;
- dst += 8;
- count -= 8;
}
}