Corrections
This commit is contained in:
@@ -192,8 +192,7 @@ void stringCrypt(char *inout, int len, bool encrypt) // encrypt true - encrypt,
|
|||||||
xteaDecipher(32, (uint32_t*)(inout + (i * BLOCK_SIZE)), key);
|
xteaDecipher(32, (uint32_t*)(inout + (i * BLOCK_SIZE)), key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (len % BLOCK_SIZE != 0)
|
if (len % BLOCK_SIZE != 0) {
|
||||||
{
|
|
||||||
int mod = len % BLOCK_SIZE;
|
int mod = len % BLOCK_SIZE;
|
||||||
int offset = (len / BLOCK_SIZE) * BLOCK_SIZE;
|
int offset = (len / BLOCK_SIZE) * BLOCK_SIZE;
|
||||||
char data[BLOCK_SIZE];
|
char data[BLOCK_SIZE];
|
||||||
@@ -205,6 +204,5 @@ void stringCrypt(char *inout, int len, bool encrypt) // encrypt true - encrypt,
|
|||||||
xteaDecipher(32, (uint32_t*)data, key);
|
xteaDecipher(32, (uint32_t*)data, key);
|
||||||
}
|
}
|
||||||
memcpy(inout + offset, data, mod);
|
memcpy(inout + offset, data, mod);
|
||||||
cout << mod << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user