Initial Commit
This commit is contained in:
50
iTechSharp/srcbc/crypto/parameters/DHPrivateKeyParameters.cs
Normal file
50
iTechSharp/srcbc/crypto/parameters/DHPrivateKeyParameters.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
|
||||
using Org.BouncyCastle.Math;
|
||||
|
||||
namespace Org.BouncyCastle.Crypto.Parameters
|
||||
{
|
||||
public class DHPrivateKeyParameters
|
||||
: DHKeyParameters
|
||||
{
|
||||
private readonly BigInteger x;
|
||||
|
||||
public DHPrivateKeyParameters(
|
||||
BigInteger x,
|
||||
DHParameters parameters)
|
||||
: base(true, parameters)
|
||||
{
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public BigInteger X
|
||||
{
|
||||
get { return x; }
|
||||
}
|
||||
|
||||
public override bool Equals(
|
||||
object obj)
|
||||
{
|
||||
if (obj == this)
|
||||
return true;
|
||||
|
||||
DHPrivateKeyParameters other = obj as DHPrivateKeyParameters;
|
||||
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return Equals(other);
|
||||
}
|
||||
|
||||
protected bool Equals(
|
||||
DHPrivateKeyParameters other)
|
||||
{
|
||||
return x.Equals(other.x) && base.Equals(other);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return x.GetHashCode() ^ base.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user