Change Parity of Scrambler

This commit is contained in:
Sn0wStorm 2016-06-30 15:32:10 +02:00
parent d194dec5c4
commit eeb0075f2e
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ public class XORScrambleStream extends FilterOutputStream {
xorStream = new SeedInputStream(seed ^ id);
out.write((byte) (id >> 8));
out.write((byte) id);
write(209); // parity/sanity
write((int) (seed >> 48) & 0xFF); // parity/sanity
}
}

View File

@ -27,7 +27,7 @@ public class XORUnscrambleStream extends FilterInputStream {
return;
}
xorStream = new SeedInputStream(seed ^ id);
if (read() != 209) { // Parity/Sanity
if (read() != ((int) (seed >> 48) & 0xFF)) { // Parity/Sanity
throw new InvalidKeyException("Could not read scrambled data, is the seed wrong?");
}
}