diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-01-24 19:18:21 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-01-24 19:18:21 +0700 |
commit | 6b5b1051ee235bd75b34e81ebb9e08a88fe5cede (patch) | |
tree | 739b56eac85317cf26866dceddbc3f40b20c0e6a /crypto/src | |
parent | Some more EC point normalization (diff) | |
download | BouncyCastle.NET-ed25519-6b5b1051ee235bd75b34e81ebb9e08a88fe5cede.tar.xz |
Formatting
Diffstat (limited to 'crypto/src')
-rw-r--r-- | crypto/src/crypto/parameters/ECPrivateKeyParameters.cs | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/crypto/src/crypto/parameters/ECPrivateKeyParameters.cs b/crypto/src/crypto/parameters/ECPrivateKeyParameters.cs index e6352d5d1..4d0fa1fc6 100644 --- a/crypto/src/crypto/parameters/ECPrivateKeyParameters.cs +++ b/crypto/src/crypto/parameters/ECPrivateKeyParameters.cs @@ -7,81 +7,81 @@ using Org.BouncyCastle.Math; namespace Org.BouncyCastle.Crypto.Parameters { public class ECPrivateKeyParameters - : ECKeyParameters + : ECKeyParameters { - private readonly BigInteger d; - - public ECPrivateKeyParameters( - BigInteger d, - ECDomainParameters parameters) - : this("EC", d, parameters) - { - } - - [Obsolete("Use version with explicit 'algorithm' parameter")] - public ECPrivateKeyParameters( - BigInteger d, - DerObjectIdentifier publicKeyParamSet) - : base("ECGOST3410", true, publicKeyParamSet) - { - if (d == null) - throw new ArgumentNullException("d"); - - this.d = d; - } - - public ECPrivateKeyParameters( - string algorithm, - BigInteger d, - ECDomainParameters parameters) - : base(algorithm, true, parameters) - { - if (d == null) - throw new ArgumentNullException("d"); - - this.d = d; - } - - public ECPrivateKeyParameters( - string algorithm, - BigInteger d, - DerObjectIdentifier publicKeyParamSet) - : base(algorithm, true, publicKeyParamSet) - { - if (d == null) - throw new ArgumentNullException("d"); - - this.d = d; - } - - public BigInteger D - { - get { return d; } - } - - public override bool Equals( - object obj) + private readonly BigInteger d; + + public ECPrivateKeyParameters( + BigInteger d, + ECDomainParameters parameters) + : this("EC", d, parameters) + { + } + + [Obsolete("Use version with explicit 'algorithm' parameter")] + public ECPrivateKeyParameters( + BigInteger d, + DerObjectIdentifier publicKeyParamSet) + : base("ECGOST3410", true, publicKeyParamSet) { - if (obj == this) - return true; + if (d == null) + throw new ArgumentNullException("d"); - ECPrivateKeyParameters other = obj as ECPrivateKeyParameters; + this.d = d; + } - if (other == null) - return false; + public ECPrivateKeyParameters( + string algorithm, + BigInteger d, + ECDomainParameters parameters) + : base(algorithm, true, parameters) + { + if (d == null) + throw new ArgumentNullException("d"); - return Equals(other); + this.d = d; } - protected bool Equals( - ECPrivateKeyParameters other) - { - return d.Equals(other.d) && base.Equals(other); - } + public ECPrivateKeyParameters( + string algorithm, + BigInteger d, + DerObjectIdentifier publicKeyParamSet) + : base(algorithm, true, publicKeyParamSet) + { + if (d == null) + throw new ArgumentNullException("d"); + + this.d = d; + } + + public BigInteger D + { + get { return d; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + ECPrivateKeyParameters other = obj as ECPrivateKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + ECPrivateKeyParameters other) + { + return d.Equals(other.d) && base.Equals(other); + } - public override int GetHashCode() + public override int GetHashCode() { return d.GetHashCode() ^ base.GetHashCode(); } - } + } } |