* DESCryptoServiceProvider.cs: Use BitConverter.IsLittleEndian
to fix for big endian machines.
svn path=/trunk/mcs/; revision=25066
+2004-04-05 Bernie Solomon <bernard@ugsolutions.com>
+
+ * DESCryptoServiceProvider.cs: Use BitConverter.IsLittleEndian
+ to fix for big endian machines.
+
2004-03-10 Sebastien Pouliot <sebastien@ximian.com>
* FromBase64Transform.cs: Now throws ObjectDisposedException and
private static void Permutation (byte [] input, byte [] _output, int [] permTab, bool preSwap)
{
- if (preSwap) BSwap (input);
+ if (preSwap && BitConverter.IsLittleEndian) BSwap (input);
byte [] output = _output;
d2 |= permTab [offs1] | permTab [offs2];
}
- if (preSwap) {
+ if (preSwap || !BitConverter.IsLittleEndian) {
output [0] = (byte) (d1);
output [1] = (byte) (d1 >> 8);
output [2] = (byte) (d1 >> 16);