using Renci.SshNet.Abstractions;
namespace Renci.SshNet.Security
{
///
/// Represents "diffie-hellman-group-exchange-sha256" algorithm implementation.
///
internal sealed class KeyExchangeDiffieHellmanGroupExchangeSha256 : KeyExchangeDiffieHellmanGroupExchangeShaBase
{
///
/// Gets algorithm name.
///
public override string Name
{
get { return "diffie-hellman-group-exchange-sha256"; }
}
///
/// Gets the size, in bits, of the computed hash code.
///
///
/// The size, in bits, of the computed hash code.
///
protected override int HashSize
{
get { return 256; }
}
///
/// Hashes the specified data bytes.
///
/// Data to hash.
///
/// The hash of the data.
///
protected override byte[] Hash(byte[] hashData)
{
using (var sha256 = CryptoAbstraction.CreateSHA256())
{
return sha256.ComputeHash(hashData);
}
}
}
}