< Summary

Information
Class: Renci.SshNet.Security.Org.BouncyCastle.Asn1.X9.X9ECPoint
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\BouncyCastle\asn1\x9\X9ECPoint.cs
Line coverage
44%
Covered lines: 12
Uncovered lines: 15
Coverable lines: 27
Total lines: 57
Line coverage: 44.4%
Branch coverage
25%
Covered branches: 2
Total branches: 8
Branch coverage: 25%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
.ctor(...)100%10%
.ctor(...)100%10%
.ctor(...)100%1100%
GetPointEncoding()100%10%
get_Point()100%2100%
get_IsPointCompressed()0%60%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\BouncyCastle\asn1\x9\X9ECPoint.cs

#LineLine coverage
 1using Renci.SshNet.Security.Org.BouncyCastle.Math.EC;
 2using Renci.SshNet.Security.Org.BouncyCastle.Utilities;
 3
 4namespace Renci.SshNet.Security.Org.BouncyCastle.Asn1.X9
 5{
 6    internal class X9ECPoint
 7    {
 8        private readonly byte[] encoding;
 9
 10        private ECCurve c;
 11        private ECPoint p;
 12
 13        public X9ECPoint(ECPoint p)
 014            : this(p, false)
 015        {
 016        }
 17
 018        public X9ECPoint(ECPoint p, bool compressed)
 019        {
 020            this.p = p.Normalize();
 021            this.encoding = p.GetEncoded(compressed);
 022        }
 23
 324        public X9ECPoint(ECCurve c, byte[] encoding)
 325        {
 326            this.c = c;
 327            this.encoding = Arrays.Clone(encoding);
 328        }
 29
 30        public byte[] GetPointEncoding()
 031        {
 032            return Arrays.Clone(encoding);
 033        }
 34
 35        public ECPoint Point
 36        {
 37            get
 938            {
 939                if (p == null)
 340                {
 341                    p = c.DecodePoint(encoding).Normalize();
 342                }
 43
 944                return p;
 945            }
 46        }
 47
 48        public bool IsPointCompressed
 49        {
 50            get
 051            {
 052                byte[] octets = encoding;
 053                return octets != null && octets.Length > 0 && (octets[0] == 2 || octets[0] == 3);
 054            }
 55        }
 56    }
 57}