KeyExchangeDiffieHellmanGroupExchangeSha1
Represents "diffie-hellman-group-exchange-sha1" algorithm implementation.
using Renci.SshNet.Abstractions;
using SshNet.Security.Cryptography;
using System;
using System.Security.Cryptography;
namespace Renci.SshNet.Security
{
internal class KeyExchangeDiffieHellmanGroupExchangeSha1 : KeyExchangeDiffieHellmanGroupExchangeShaBase
{
public override string Name => "diffie-hellman-group-exchange-sha1";
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();
}
}
}
}