< Summary

Information
Class: Renci.SshNet.Security.KeyExchangeECDH384
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\KeyExchangeECDH384.cs
Line coverage
90%
Covered lines: 9
Uncovered lines: 1
Coverable lines: 10
Total lines: 54
Line coverage: 90%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_Name()100%1100%
get_CurveParameter()100%1100%
get_HashSize()100%10%
Hash(...)100%1100%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\KeyExchangeECDH384.cs

#LineLine coverage
 1using Renci.SshNet.Abstractions;
 2using Renci.SshNet.Security.Org.BouncyCastle.Asn1.Sec;
 3using Renci.SshNet.Security.Org.BouncyCastle.Asn1.X9;
 4
 5namespace Renci.SshNet.Security
 6{
 7    internal sealed class KeyExchangeECDH384 : KeyExchangeECDH
 8    {
 9        /// <summary>
 10        /// Gets algorithm name.
 11        /// </summary>
 12        public override string Name
 13        {
 914            get { return "ecdh-sha2-nistp384"; }
 15        }
 16
 17        /// <summary>
 18        /// Gets Curve Parameter.
 19        /// </summary>
 20        protected override X9ECParameters CurveParameter
 21        {
 22            get
 1523            {
 1524                return SecNamedCurves.GetByName("P-384");
 1525            }
 26        }
 27
 28        /// <summary>
 29        /// Gets the size, in bits, of the computed hash code.
 30        /// </summary>
 31        /// <value>
 32        /// The size, in bits, of the computed hash code.
 33        /// </value>
 34        protected override int HashSize
 35        {
 036            get { return 384; }
 37        }
 38
 39        /// <summary>
 40        /// Hashes the specified data bytes.
 41        /// </summary>
 42        /// <param name="hashData">The hash data.</param>
 43        /// <returns>
 44        /// The hash of the data.
 45        /// </returns>
 46        protected override byte[] Hash(byte[] hashData)
 2447        {
 2448            using (var sha384 = CryptoAbstraction.CreateSHA384())
 2449            {
 2450                return sha384.ComputeHash(hashData, 0, hashData.Length);
 51            }
 2452        }
 53    }
 54}