mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 20:43:08 +02:00
Fix XORing algorithm
This commit is contained in:
parent
3a11e84c94
commit
f06ac911c5
1 changed files with 1 additions and 3 deletions
|
@ -27,12 +27,10 @@ void saltingHelper(char* start, int size, Key key) {
|
|||
const auto end = start + size;
|
||||
|
||||
auto p = start;
|
||||
for (; p < end; p += sizeof(Key)) {
|
||||
for (; p + sizeof(Key) < end; p += sizeof(Key)) {
|
||||
*reinterpret_cast<Key*>(p) ^= key;
|
||||
}
|
||||
|
||||
p -= sizeof(Key);
|
||||
|
||||
for (int i = 0; p < end; ++p || ++i) {
|
||||
*p ^= *(reinterpret_cast<const char*>(&key) + i);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue