Fix bitwise calculation losing data.

This commit is contained in:
2021-08-17 17:41:14 +01:00
parent 73b212d3bb
commit 36b638fd4e

View File

@@ -571,7 +571,7 @@ namespace Aaru.Decryption.DVD
lfsr1Lo = ((lfsr1Lo & 1) << 8) ^ oLfsr1;
oLfsr1 = _cssTable4[oLfsr1];
byte oLfsr0 = (byte)(((((((lfsr0 >> 8) ^ lfsr0) >> 1) ^ lfsr0) >> 3) ^ lfsr0) >> 7);
lfsr0 = (uint)((lfsr0 >> 8) | (oLfsr0 << 24));
lfsr0 = (lfsr0 >> 8) | ((uint)oLfsr0 << 24);
combined += (uint)((oLfsr0 ^ invert) + oLfsr1);
k[i] = (byte)(combined & 0xff);
combined >>= 8;