using Renci.SshNet.Abstractions;
using Renci.SshNet.Security.Org.BouncyCastle.Asn1.Sec;
using Renci.SshNet.Security.Org.BouncyCastle.Asn1.X9;
namespace Renci.SshNet.Security
{
internal sealed class KeyExchangeECDH384 : KeyExchangeECDH
{
///
/// Gets algorithm name.
///
public override string Name
{
get { return "ecdh-sha2-nistp384"; }
}
///
/// Gets Curve Parameter.
///
protected override X9ECParameters CurveParameter
{
get
{
return SecNamedCurves.GetByName("P-384");
}
}
///
/// 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 384; }
}
///
/// Hashes the specified data bytes.
///
/// The hash data.
///
/// The hash of the data.
///
protected override byte[] Hash(byte[] hashData)
{
using (var sha384 = CryptoAbstraction.CreateSHA384())
{
return sha384.ComputeHash(hashData, 0, hashData.Length);
}
}
}
}