< Summary

Information
Class: Renci.SshNet.Security.KeyExchangeDiffieHellmanGroupExchangeSha1
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\KeyExchangeDiffieHellmanGroupExchangeSha1.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 44
Line coverage: 100%
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_HashSize()100%1100%
Hash(...)100%1100%

File(s)

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

#LineLine coverage
 1using Renci.SshNet.Abstractions;
 2
 3namespace Renci.SshNet.Security
 4{
 5    /// <summary>
 6    /// Represents "diffie-hellman-group-exchange-sha1" algorithm implementation.
 7    /// </summary>
 8    internal sealed class KeyExchangeDiffieHellmanGroupExchangeSha1 : KeyExchangeDiffieHellmanGroupExchangeShaBase
 9    {
 10        /// <summary>
 11        /// Gets algorithm name.
 12        /// </summary>
 13        public override string Name
 14        {
 915            get { return "diffie-hellman-group-exchange-sha1"; }
 16        }
 17
 18        /// <summary>
 19        /// Gets the size, in bits, of the computed hash code.
 20        /// </summary>
 21        /// <value>
 22        /// The size, in bits, of the computed hash code.
 23        /// </value>
 24        protected override int HashSize
 25        {
 926            get { return 160; }
 27        }
 28
 29        /// <summary>
 30        /// Hashes the specified data bytes.
 31        /// </summary>
 32        /// <param name="hashData">The hash data.</param>
 33        /// <returns>
 34        /// The hash of the data.
 35        /// </returns>
 36        protected override byte[] Hash(byte[] hashData)
 2437        {
 2438            using (var sha1 = CryptoAbstraction.CreateSHA1())
 2439            {
 2440                return sha1.ComputeHash(hashData, 0, hashData.Length);
 41            }
 2442        }
 43    }
 44}