< Summary

Information
Class: Renci.SshNet.Security.Org.BouncyCastle.Crypto.Parameters.ECPrivateKeyParameters
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\BouncyCastle\crypto\parameters\ECPrivateKeyParameters.cs
Line coverage
25%
Covered lines: 6
Uncovered lines: 18
Coverable lines: 24
Total lines: 61
Line coverage: 25%
Branch coverage
12%
Covered branches: 1
Total branches: 8
Branch coverage: 12.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
.ctor(...)100%10%
.ctor(...)50%283.33%
get_D()100%1100%
Equals(...)0%40%
Equals(...)0%20%
GetHashCode()100%10%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\BouncyCastle\crypto\parameters\ECPrivateKeyParameters.cs

#LineLine coverage
 1using System;
 2
 3using Renci.SshNet.Security.Org.BouncyCastle.Math;
 4
 5namespace Renci.SshNet.Security.Org.BouncyCastle.Crypto.Parameters
 6{
 7    internal class ECPrivateKeyParameters
 8        : ECKeyParameters
 9    {
 10        private readonly BigInteger d;
 11
 12        public ECPrivateKeyParameters(
 13            BigInteger      d,
 14            ECDomainParameters  parameters)
 015            : this("EC", d, parameters)
 016        {
 017        }
 18
 19        public ECPrivateKeyParameters(
 20            string        algorithm,
 21            BigInteger      d,
 22            ECDomainParameters  parameters)
 923            : base(algorithm, true, parameters)
 924        {
 925            if (d == null)
 026                throw new ArgumentNullException("d");
 27
 928            this.d = d;
 929        }
 30
 31        public BigInteger D
 32        {
 2733            get { return d; }
 34        }
 35
 36        public override bool Equals(
 37            object obj)
 038        {
 039            if (obj == this)
 040                return true;
 41
 042            ECPrivateKeyParameters other = obj as ECPrivateKeyParameters;
 43
 044            if (other == null)
 045                return false;
 46
 047            return Equals(other);
 048        }
 49
 50        protected bool Equals(
 51            ECPrivateKeyParameters other)
 052        {
 053            return d.Equals(other.d) && base.Equals(other);
 054        }
 55
 56        public override int GetHashCode()
 057        {
 058            return d.GetHashCode() ^ base.GetHashCode();
 059        }
 60    }
 61}