# < Summary

Information

Class: | Renci.SshNet.Security.Org.BouncyCastle.Crypto.Parameters.ECDomainParameters
Assembly: | Renci.SshNet
File(s): | \home\appveyor\projects\ssh-net\src\Renci.SshNet\Security\BouncyCastle\crypto\parameters\ECDomainParameters.cs

Line coverage
64%

Covered lines: | 27
Uncovered lines: | 15
Coverable lines: | 42
Total lines: | 91
Line coverage: | 64.2%

Branch coverage
42%

Covered branches: | 6
Total branches: | 14
Branch coverage: | 42.8%

Method coverage

Feature is only available for sponsors

Upgrade to PRO version

# Metrics

Method | Branch coverage | Cyclomatic complexity | Line coverage
--- | --- | --- | ---
.ctor(...) | 50% | 6 | 84.21%
get_Curve() | 100% | 1 | 100%
get_G() | 100% | 1 | 100%
get_N() | 100% | 1 | 100%
get_H() | 100% | 1 | 100%
get_HInv() | 0% | 2 | 0%
Validate(...) | 50% | 6 | 70%

# File(s)

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

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System;`
|  | `2` |  | ``
|  | `3` |  | `using Renci.SshNet.Security.Org.BouncyCastle.Math;`
|  | `4` |  | `using Renci.SshNet.Security.Org.BouncyCastle.Math.EC;`
|  | `5` |  | `using Renci.SshNet.Security.Org.BouncyCastle.Utilities;`
|  | `6` |  | ``
|  | `7` |  | `namespace Renci.SshNet.Security.Org.BouncyCastle.Crypto.Parameters`
|  | `8` |  | `{`
|  | `9` |  | `internal class ECDomainParameters`
|  | `10` |  | `{`
|  | `11` |  | `internal ECCurve curve;`
|  | `12` |  | `internal byte[] seed;`
|  | `13` |  | `internal ECPoint g;`
|  | `14` |  | `internal BigInteger n;`
|  | `15` |  | `internal BigInteger h;`
|  | `16` |  | `internal BigInteger hInv;`
|  | `17` |  | ``
| 9 | `18` |  | `public ECDomainParameters(`
| 9 | `19` |  | `ECCurve curve,`
| 9 | `20` |  | `ECPoint g,`
| 9 | `21` |  | `BigInteger n,`
| 9 | `22` |  | `BigInteger h,`
| 9 | `23` |  | `byte[] seed)`
| 9 | `24` |  | `{`
| 9 | `25` |  | `if (curve == null)`
| 0 | `26` |  | `throw new ArgumentNullException("curve");`
| 9 | `27` |  | `if (g == null)`
| 0 | `28` |  | `throw new ArgumentNullException("g");`
| 9 | `29` |  | `if (n == null)`
| 0 | `30` |  | `throw new ArgumentNullException("n");`
|  | `31` |  | `// we can't check for h == null here as h is optional in X9.62 as it is not required for ECDSA`
|  | `32` |  | ``
| 9 | `33` |  | `this.curve = curve;`
| 9 | `34` |  | `this.g = Validate(curve, g);`
| 9 | `35` |  | `this.n = n;`
| 9 | `36` |  | `this.h = h;`
| 9 | `37` |  | `this.seed = Arrays.Clone(seed);`
| 9 | `38` |  | `}`
|  | `39` |  | ``
|  | `40` |  | `public ECCurve Curve`
|  | `41` |  | `{`
| 108 | `42` |  | `get { return curve; }`
|  | `43` |  | `}`
|  | `44` |  | ``
|  | `45` |  | `public ECPoint G`
|  | `46` |  | `{`
| 27 | `47` |  | `get { return g; }`
|  | `48` |  | `}`
|  | `49` |  | ``
|  | `50` |  | `public BigInteger N`
|  | `51` |  | `{`
| 81 | `52` |  | `get { return n; }`
|  | `53` |  | `}`
|  | `54` |  | ``
|  | `55` |  | `public BigInteger H`
|  | `56` |  | `{`
| 27 | `57` |  | `get { return h; }`
|  | `58` |  | `}`
|  | `59` |  | ``
|  | `60` |  | `public BigInteger HInv`
|  | `61` |  | `{`
|  | `62` |  | `get`
| 0 | `63` |  | `{`
| 0 | `64` |  | `lock (this)`
| 0 | `65` |  | `{`
| 0 | `66` |  | `if (hInv == null)`
| 0 | `67` |  | `{`
| 0 | `68` |  | `hInv = h.ModInverse(n);`
| 0 | `69` |  | `}`
| 0 | `70` |  | `return hInv;`
|  | `71` |  | `}`
| 0 | `72` |  | `}`
|  | `73` |  | `}`
|  | `74` |  | ``
|  | `75` |  | `internal static ECPoint Validate(ECCurve c, ECPoint q)`
| 27 | `76` |  | `{`
| 27 | `77` |  | `if (q == null)`
| 0 | `78` |  | `throw new ArgumentException("Point has null value", "q");`
|  | `79` |  | ``
| 27 | `80` |  | `q = ECAlgorithms.ImportPoint(c, q).Normalize();`
|  | `81` |  | ``
| 27 | `82` |  | `if (q.IsInfinity)`
| 0 | `83` |  | `throw new ArgumentException("Point at infinity", "q");`
|  | `84` |  | ``
| 27 | `85` |  | `if (!q.IsValid())`
| 0 | `86` |  | `throw new ArgumentException("Point not on curve", "q");`
|  | `87` |  | ``
| 27 | `88` |  | `return q;`
| 27 | `89` |  | `}`
|  | `90` |  | `}`
|  | `91` |  | `}`

# Methods/Properties

.ctor(Renci.SshNet.Security.Org.BouncyCastle.Math.EC.ECCurve,Renci.SshNet.Security.Org.BouncyCastle.Math.EC.ECPoint,Renci.SshNet.Security.Org.BouncyCastle.Math.BigInteger,Renci.SshNet.Security.Org.BouncyCastle.Math.BigInteger,System.Byte[])
get_Curve()
get_G()
get_N()
get_H()
get_HInv()
Validate(Renci.SshNet.Security.Org.BouncyCastle.Math.EC.ECCurve,Renci.SshNet.Security.Org.BouncyCastle.Math.EC.ECPoint)