The ReadInt64 method of SshData is not correct. It casts to int before return, and the shifts are missing a cast to long type of thing (as the default shift works on expects int values, and 56 bits don't fit in that case.)
Comments: ** Comment from web user: rjvdboon **
Comments: ** Comment from web user: rjvdboon **
My bit-shifting capabilities are limited (I can read it, but writing it correctly is beyond me;-)
What I would do instead is:
var bytes = ReadBytes(8);
if (BitConverter.IsLittleEndian)
Array.Reverse(bytes);
return BitConverter.ToInt64(bytes,0);
Is that performant enough for you?