KeyExchangeDiffieHellmanGroupSha1
Represents "diffie-hellman-group1-sha1" algorithm implementation.
using Renci.SshNet.Abstractions;
using SshNet.Security.Cryptography;
using System;
using System.Security.Cryptography;
namespace Renci.SshNet.Security
{
internal abstract class KeyExchangeDiffieHellmanGroupSha1 : KeyExchangeDiffieHellmanGroupShaBase
{
protected override int HashSize => 160;
protected override byte[] Hash(byte[] hashData)
{
SHA1 val = CryptoAbstraction.CreateSHA1();
try {
return ((HashAlgorithm)val).ComputeHash(hashData, 0, hashData.Length);
} finally {
((IDisposable)val)?.Dispose();
}
}
}
}