KeyExchangeDiffieHellmanGroupSha256
Base class for "diffie-hellman" SHA-256 group algorithm implementations.
using Renci.SshNet.Abstractions;
using SshNet.Security.Cryptography;
using System;
using System.Security.Cryptography;
namespace Renci.SshNet.Security
{
internal abstract class KeyExchangeDiffieHellmanGroupSha256 : KeyExchangeDiffieHellmanGroupShaBase
{
protected override int HashSize => 256;
protected override byte[] Hash(byte[] hashData)
{
SHA256 val = CryptoAbstraction.CreateSHA256();
try {
return ((HashAlgorithm)val).ComputeHash(hashData);
} finally {
((IDisposable)val)?.Dispose();
}
}
}
}