< Summary

Information
Class: Renci.SshNet.Security.Org.BouncyCastle.Crypto.Parameters.ECPublicKeyParameters
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\BouncyCastle\crypto\parameters\ECPublicKeyParameters.cs
Line coverage
25%
Covered lines: 6
Uncovered lines: 18
Coverable lines: 24
Total lines: 60
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_Q()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\ECPublicKeyParameters.cs

#LineLine coverage
 1using System;
 2
 3using Renci.SshNet.Security.Org.BouncyCastle.Math.EC;
 4
 5namespace Renci.SshNet.Security.Org.BouncyCastle.Crypto.Parameters
 6{
 7    internal class ECPublicKeyParameters
 8        : ECKeyParameters
 9    {
 10        private readonly ECPoint q;
 11
 12        public ECPublicKeyParameters(
 13            ECPoint        q,
 14            ECDomainParameters  parameters)
 015            : this("EC", q, parameters)
 016        {
 017        }
 18
 19        public ECPublicKeyParameters(
 20            string        algorithm,
 21            ECPoint        q,
 22            ECDomainParameters  parameters)
 1823            : base(algorithm, false, parameters)
 1824        {
 1825            if (q == null)
 026                throw new ArgumentNullException("q");
 27
 1828            this.q = ECDomainParameters.Validate(Parameters.Curve, q);
 1829        }
 30
 31        public ECPoint Q
 32        {
 5433            get { return q; }
 34        }
 35
 36        public override bool Equals(object obj)
 037        {
 038            if (obj == this)
 039                return true;
 40
 041            ECPublicKeyParameters other = obj as ECPublicKeyParameters;
 42
 043            if (other == null)
 044                return false;
 45
 046            return Equals(other);
 047        }
 48
 49        protected bool Equals(
 50            ECPublicKeyParameters other)
 051        {
 052            return q.Equals(other.q) && base.Equals(other);
 053        }
 54
 55        public override int GetHashCode()
 056        {
 057            return q.GetHashCode() ^ base.GetHashCode();
 058        }
 59    }
 60}