mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-02-10 00:11:25 +01:00
Change Parity of Scrambler
This commit is contained in:
parent
562f96e4b1
commit
2fc0b32179
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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?");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user