KeyExchangeDiffieHellmanGroupExchangeSha256
Represents "diffie-hellman-group-exchange-sha256" algorithm implementation.
using Renci.SshNet.Abstractions;
using SshNet.Security.Cryptography;
using System;
using System.Security.Cryptography;
namespace Renci.SshNet.Security
{
internal class KeyExchangeDiffieHellmanGroupExchangeSha256 : KeyExchangeDiffieHellmanGroupExchangeShaBase
{
public override string Name => "diffie-hellman-group-exchange-sha256";
protected override int HashSize => 256;
protected override byte[] Hash(byte[] hashBytes)
{
SHA256 val = CryptoAbstraction.CreateSHA256();
try {
return ((HashAlgorithm)val).ComputeHash(hashBytes);
} finally {
((IDisposable)val)?.Dispose();
}
}
}
}