Browse Source

Make methods static where possible.

drieseng 9 years ago
parent
commit
1ac19b86a0

+ 3 - 3
src/Renci.SshNet/ScpClient.cs

@@ -240,7 +240,7 @@ namespace Renci.SshNet
             }
         }
 
-        private void InternalSetTimestamp(IChannelSession channel, Stream input, DateTime lastWriteTime, DateTime lastAccessime)
+        private static void InternalSetTimestamp(IChannelSession channel, Stream input, DateTime lastWriteTime, DateTime lastAccessime)
         {
             var zeroTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
             var modificationSeconds = (long) (lastWriteTime - zeroTime).TotalSeconds;
@@ -321,12 +321,12 @@ namespace Renci.SshNet
             }
         }
 
-        private void SendConfirmation(IChannel channel)
+        private static void SendConfirmation(IChannel channel)
         {
             SendData(channel, new byte[] { 0 });
         }
 
-        private void SendConfirmation(IChannel channel, byte errorCode, string message)
+        private static void SendConfirmation(IChannel channel, byte errorCode, string message)
         {
             SendData(channel, new[] { errorCode });
             SendData(channel, string.Format("{0}\n", message));

+ 4 - 4
src/Renci.SshNet/Security/Cryptography/Ciphers/AesCipher.cs

@@ -718,17 +718,17 @@ namespace Renci.SshNet.Security.Cryptography.Ciphers
             return W;
         }
 
-        private uint Shift(uint r, int shift)
+        private static uint Shift(uint r, int shift)
         {
             return (r >> shift) | (r << (32 - shift));
         }
 
-        private uint FFmulX(uint x)
+        private static uint FFmulX(uint x)
         {
             return ((x & m2) << 1) ^ (((x & m1) >> 7) * m3);
         }
 
-        private uint InvMcol(uint x)
+        private static uint InvMcol(uint x)
         {
             uint f2 = FFmulX(x);
             uint f4 = FFmulX(f2);
@@ -738,7 +738,7 @@ namespace Renci.SshNet.Security.Cryptography.Ciphers
             return f2 ^ f4 ^ f8 ^ Shift(f2 ^ f9, 8) ^ Shift(f4 ^ f9, 16) ^ Shift(f9, 24);
         }
 
-        private uint SubWord(uint x)
+        private static uint SubWord(uint x)
         {
             return (uint)S[x & 255]
                 | (((uint)S[(x >> 8) & 255]) << 8)

+ 1 - 1
src/Renci.SshNet/Security/KeyExchange.cs

@@ -365,7 +365,7 @@ namespace Renci.SshNet.Security
         /// <param name="p">The p.</param>
         /// <param name="sessionId">The session id.</param>
         /// <returns></returns>
-        private byte[] GenerateSessionKey(BigInteger sharedKey, byte[] exchangeHash, char p, byte[] sessionId)
+        private static byte[] GenerateSessionKey(BigInteger sharedKey, byte[] exchangeHash, char p, byte[] sessionId)
         {
             return new _SessionKeyGeneration
             {

+ 1 - 1
src/Renci.SshNet/Sftp/SftpSession.cs

@@ -1112,7 +1112,7 @@ namespace Renci.SshNet.Sftp
             return Math.Min(bufferSize, maximumPacketSize) - lengthOfNonDataProtocolFields;
         }
 
-        private SshException GetSftpException(SftpStatusResponse response)
+        private static SshException GetSftpException(SftpStatusResponse response)
         {
             if (response.StatusCode == StatusCodes.Ok)
             {