init commit

This commit is contained in:
2025-10-09 09:57:24 +09:00
commit 4d551bd74f
6636 changed files with 1218703 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
using System;
using Org.BouncyCastle.Asn1;
using Org.BouncyCastle.Math.EC;
namespace Org.BouncyCastle.Crypto.Parameters;
public class ECPublicKeyParameters : ECKeyParameters
{
private readonly ECPoint q;
public ECPoint Q => q;
public ECPublicKeyParameters(ECPoint q, ECDomainParameters parameters)
: this("EC", q, parameters)
{
}
[Obsolete("Use version with explicit 'algorithm' parameter")]
public ECPublicKeyParameters(ECPoint q, DerObjectIdentifier publicKeyParamSet)
: base("ECGOST3410", isPrivate: false, publicKeyParamSet)
{
if (q == null)
{
throw new ArgumentNullException("q");
}
this.q = ECDomainParameters.Validate(base.Parameters.Curve, q);
}
public ECPublicKeyParameters(string algorithm, ECPoint q, ECDomainParameters parameters)
: base(algorithm, isPrivate: false, parameters)
{
if (q == null)
{
throw new ArgumentNullException("q");
}
this.q = ECDomainParameters.Validate(base.Parameters.Curve, q);
}
public ECPublicKeyParameters(string algorithm, ECPoint q, DerObjectIdentifier publicKeyParamSet)
: base(algorithm, isPrivate: false, publicKeyParamSet)
{
if (q == null)
{
throw new ArgumentNullException("q");
}
this.q = ECDomainParameters.Validate(base.Parameters.Curve, q);
}
public override bool Equals(object obj)
{
if (obj == this)
{
return true;
}
if (!(obj is ECPublicKeyParameters other))
{
return false;
}
return Equals(other);
}
protected bool Equals(ECPublicKeyParameters other)
{
if (q.Equals(other.q))
{
return Equals((ECKeyParameters)other);
}
return false;
}
public override int GetHashCode()
{
return q.GetHashCode() ^ base.GetHashCode();
}
}