Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions src/Renci.SshNet/Security/BouncyCastle/asn1/x9/X9Curve.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,6 @@ internal class X9ECParameters
{
private byte[] seed;

public static X9ECParameters GetInstance(Object obj)
{
if (obj is X9ECParameters)
return (X9ECParameters)obj;

return null;
}

public X9ECParameters(
ECCurve curve,
ECPoint g,
BigInteger n)
: this(curve, g, n, null, null)
{
}

public X9ECParameters(
ECCurve curve,
X9ECPoint g,
BigInteger n,
BigInteger h)
: this(curve, g, n, h, null)
{
}

public X9ECParameters(
ECCurve curve,
ECPoint g,
BigInteger n,
BigInteger h)
: this(curve, g, n, h, null)
{
}

public X9ECParameters(
ECCurve curve,
ECPoint g,
BigInteger n,
BigInteger h,
byte[] seed)
: this(curve, new X9ECPoint(g), n, h, seed)
{
}

public X9ECParameters(
ECCurve curve,
X9ECPoint g,
Expand Down Expand Up @@ -83,11 +39,6 @@ public byte[] GetSeed()
return seed;
}

public X9Curve CurveEntry
{
get { return new X9Curve(Curve, seed); }
}

public X9ECPoint BaseEntry { get; private set; }
}
}
27 changes: 1 addition & 26 deletions src/Renci.SshNet/Security/BouncyCastle/asn1/x9/X9ECPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,12 @@ internal class X9ECPoint
private ECCurve c;
private ECPoint p;

public X9ECPoint(ECPoint p)
: this(p, false)
{
}

public X9ECPoint(ECPoint p, bool compressed)
{
this.p = p.Normalize();
this.encoding = p.GetEncoded(compressed);
}

public X9ECPoint(ECCurve c, byte[] encoding)
{
this.c = c;
this.encoding = Arrays.Clone(encoding);
}

public byte[] GetPointEncoding()
{
return Arrays.Clone(encoding);
}

public ECPoint Point
{
get
Expand All @@ -44,14 +28,5 @@ public ECPoint Point
return p;
}
}

public bool IsPointCompressed
{
get
{
byte[] octets = encoding;
return octets != null && octets.Length > 0 && (octets[0] == 2 || octets[0] == 3);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Renci.SshNet.Security.Org.BouncyCastle.Crypto.Digests
{
internal abstract class GeneralDigest
: IDigest, IMemoable
: IDigest
{
private const int BYTE_LENGTH = 64;

Expand Down Expand Up @@ -123,7 +123,5 @@ public int GetByteLength()
public abstract string AlgorithmName { get; }
public abstract int GetDigestSize();
public abstract int DoFinal(byte[] output, int outOff);
public abstract IMemoable Copy();
public abstract void Reset(IMemoable t);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -263,18 +263,5 @@ private static uint Theta1(
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
};

public override IMemoable Copy()
{
return new Sha256Digest(this);
}

public override void Reset(IMemoable other)
{
Sha256Digest d = (Sha256Digest)other;

CopyIn(d);
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,5 @@ protected virtual ECMultiplier CreateBasePointMultiplier()
{
return new FixedPointCombMultiplier();
}

internal static ECPublicKeyParameters GetCorrespondingPublicKey(
ECPrivateKeyParameters privKey)
{
ECDomainParameters ec = privKey.Parameters;
ECPoint q = new FixedPointCombMultiplier().Multiply(ec.G, privKey.D);

return new ECPublicKeyParameters(privKey.AlgorithmName, q, ec);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,6 @@ public BigInteger H
get { return h; }
}

public BigInteger HInv
{
get
{
lock (this)
{
if (hInv == null)
{
hInv = h.ModInverse(n);
}
return hInv;
}
}
}

internal static ECPoint Validate(ECCurve c, ECPoint q)
{
if (q == null)
Expand All @@ -88,4 +73,4 @@ internal static ECPoint Validate(ECCurve c, ECPoint q)
return q;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,11 @@ public override int GetHashCode()
return parameters.GetHashCode() ^ base.GetHashCode();
}

internal ECKeyGenerationParameters CreateKeyGenerationParameters(
SecureRandom random)
{
return new ECKeyGenerationParameters(parameters, random);
}

internal static string VerifyAlgorithmName(string algorithm)
{
if (Array.IndexOf(algorithms, algorithm, 0, algorithms.Length) < 0)
throw new ArgumentException("unrecognised algorithm: " + algorithm, "algorithm");
return algorithm.ToUpper();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ internal class ECPrivateKeyParameters
{
private readonly BigInteger d;

public ECPrivateKeyParameters(
BigInteger d,
ECDomainParameters parameters)
: this("EC", d, parameters)
{
}

public ECPrivateKeyParameters(
string algorithm,
BigInteger d,
Expand Down Expand Up @@ -58,4 +51,4 @@ public override int GetHashCode()
return d.GetHashCode() ^ base.GetHashCode();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ internal class ECPublicKeyParameters
{
private readonly ECPoint q;

public ECPublicKeyParameters(
ECPoint q,
ECDomainParameters parameters)
: this("EC", q, parameters)
{
}

public ECPublicKeyParameters(
string algorithm,
ECPoint q,
Expand Down Expand Up @@ -57,4 +50,4 @@ public override int GetHashCode()
return q.GetHashCode() ^ base.GetHashCode();
}
}
}
}
Loading