Skip to content

Commit 1ac19b8

Browse files
committed
Make methods static where possible.
1 parent 7ccee44 commit 1ac19b8

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/Renci.SshNet/ScpClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public void Download(string filename, Stream destination)
240240
}
241241
}
242242

243-
private void InternalSetTimestamp(IChannelSession channel, Stream input, DateTime lastWriteTime, DateTime lastAccessime)
243+
private static void InternalSetTimestamp(IChannelSession channel, Stream input, DateTime lastWriteTime, DateTime lastAccessime)
244244
{
245245
var zeroTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
246246
var modificationSeconds = (long) (lastWriteTime - zeroTime).TotalSeconds;
@@ -321,12 +321,12 @@ private void RaiseUploadingEvent(string filename, long size, long uploaded)
321321
}
322322
}
323323

324-
private void SendConfirmation(IChannel channel)
324+
private static void SendConfirmation(IChannel channel)
325325
{
326326
SendData(channel, new byte[] { 0 });
327327
}
328328

329-
private void SendConfirmation(IChannel channel, byte errorCode, string message)
329+
private static void SendConfirmation(IChannel channel, byte errorCode, string message)
330330
{
331331
SendData(channel, new[] { errorCode });
332332
SendData(channel, string.Format("{0}\n", message));

src/Renci.SshNet/Security/Cryptography/Ciphers/AesCipher.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,17 +718,17 @@ private uint[] GenerateWorkingKey(bool isEncryption, byte[] key)
718718
return W;
719719
}
720720

721-
private uint Shift(uint r, int shift)
721+
private static uint Shift(uint r, int shift)
722722
{
723723
return (r >> shift) | (r << (32 - shift));
724724
}
725725

726-
private uint FFmulX(uint x)
726+
private static uint FFmulX(uint x)
727727
{
728728
return ((x & m2) << 1) ^ (((x & m1) >> 7) * m3);
729729
}
730730

731-
private uint InvMcol(uint x)
731+
private static uint InvMcol(uint x)
732732
{
733733
uint f2 = FFmulX(x);
734734
uint f4 = FFmulX(f2);
@@ -738,7 +738,7 @@ private uint InvMcol(uint x)
738738
return f2 ^ f4 ^ f8 ^ Shift(f2 ^ f9, 8) ^ Shift(f4 ^ f9, 16) ^ Shift(f9, 24);
739739
}
740740

741-
private uint SubWord(uint x)
741+
private static uint SubWord(uint x)
742742
{
743743
return (uint)S[x & 255]
744744
| (((uint)S[(x >> 8) & 255]) << 8)

src/Renci.SshNet/Security/KeyExchange.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ private byte[] GenerateSessionKey(BigInteger sharedKey, byte[] exchangeHash, byt
365365
/// <param name="p">The p.</param>
366366
/// <param name="sessionId">The session id.</param>
367367
/// <returns></returns>
368-
private byte[] GenerateSessionKey(BigInteger sharedKey, byte[] exchangeHash, char p, byte[] sessionId)
368+
private static byte[] GenerateSessionKey(BigInteger sharedKey, byte[] exchangeHash, char p, byte[] sessionId)
369369
{
370370
return new _SessionKeyGeneration
371371
{

src/Renci.SshNet/Sftp/SftpSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ public uint CalculateOptimalWriteLength(uint bufferSize, byte[] handle)
11121112
return Math.Min(bufferSize, maximumPacketSize) - lengthOfNonDataProtocolFields;
11131113
}
11141114

1115-
private SshException GetSftpException(SftpStatusResponse response)
1115+
private static SshException GetSftpException(SftpStatusResponse response)
11161116
{
11171117
if (response.StatusCode == StatusCodes.Ok)
11181118
{

0 commit comments

Comments
 (0)