Skip to content

Commit

Permalink
removed unnecessary extra ECGOST3410 class
Browse files Browse the repository at this point in the history
  • Loading branch information
dghbc committed Jan 24, 2019
1 parent e2d496e commit a7a5659
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 154 deletions.
15 changes: 14 additions & 1 deletion crypto/src/crypto/signers/ECGOST3410Signer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ public class ECGost3410Signer
{
private ECKeyParameters key;
private SecureRandom random;
private bool forSigning;

public virtual string AlgorithmName
{
get { return "ECGOST3410"; }
get { return key.AlgorithmName; }
}

public virtual void Init(
bool forSigning,
ICipherParameters parameters)
{
this.forSigning = forSigning;

if (forSigning)
{
if (parameters is ParametersWithRandom)
Expand Down Expand Up @@ -70,6 +73,11 @@ public virtual BigInteger Order
public virtual BigInteger[] GenerateSignature(
byte[] message)
{
if (!forSigning)
{
throw new InvalidOperationException("not initialized for signing");
}

byte[] mRev = new byte[message.Length]; // conversion is little-endian
for (int i = 0; i != mRev.Length; i++)
{
Expand Down Expand Up @@ -120,6 +128,11 @@ public virtual bool VerifySignature(
BigInteger r,
BigInteger s)
{
if (forSigning)
{
throw new InvalidOperationException("not initialized for verification");
}

byte[] mRev = new byte[message.Length]; // conversion is little-endian
for (int i = 0; i != mRev.Length; i++)
{
Expand Down
153 changes: 0 additions & 153 deletions crypto/src/crypto/signers/ECGost3410_2012Signer.cs

This file was deleted.

0 comments on commit a7a5659

Please sign in to comment.