You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.1 KiB
58 lines
1.1 KiB
8 months ago
|
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||
|
#pragma warning disable
|
||
|
using System;
|
||
|
|
||
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Math;
|
||
|
|
||
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters
|
||
|
{
|
||
|
public class ElGamalPrivateKeyParameters
|
||
|
: ElGamalKeyParameters
|
||
|
{
|
||
|
private readonly BigInteger x;
|
||
|
|
||
|
public ElGamalPrivateKeyParameters(
|
||
|
BigInteger x,
|
||
|
ElGamalParameters parameters)
|
||
|
: base(true, parameters)
|
||
|
{
|
||
|
if (x == null)
|
||
|
throw new ArgumentNullException("x");
|
||
|
|
||
|
this.x = x;
|
||
|
}
|
||
|
|
||
|
public BigInteger X
|
||
|
{
|
||
|
get { return x; }
|
||
|
}
|
||
|
|
||
|
public override bool Equals(
|
||
|
object obj)
|
||
|
{
|
||
|
if (obj == this)
|
||
|
return true;
|
||
|
|
||
|
ElGamalPrivateKeyParameters other = obj as ElGamalPrivateKeyParameters;
|
||
|
|
||
|
if (other == null)
|
||
|
return false;
|
||
|
|
||
|
return Equals(other);
|
||
|
}
|
||
|
|
||
|
protected bool Equals(
|
||
|
ElGamalPrivateKeyParameters other)
|
||
|
{
|
||
|
return other.x.Equals(x) && base.Equals(other);
|
||
|
}
|
||
|
|
||
|
public override int GetHashCode()
|
||
|
{
|
||
|
return x.GetHashCode() ^ base.GetHashCode();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
#pragma warning restore
|
||
|
#endif
|