Happy Monday. This works without the additional whitening and sram key.
Code:
private static byte[] generateECC(byte[] buffer)
{
byte[] sram = new byte[((buffer.Length / 0x80) * 0x02)];
for(int address = 0; address < buffer.Length; address += 0x80)
{
UInt16 value = 0x00;
for (int offset = 0; offset < 0x80; offset += 0x02)
{
UInt16 nextValue = BitIO.ToUInt16(buffer, address + offset);
nextValue = BitIO.RotateRight16(nextValue, (offset / 0x08) + 0x01);
value ^= nextValue;
}
Buffer.BlockCopy(BitIO.GetBytes(value), 0x00, sram, ((address / 0x80) * 0x02), 0x02);
}
return sram;
}