Skip to content

Commit

Permalink
Fix hokey test
Browse files Browse the repository at this point in the history
- (previously unused key data copied from DSATest)
  • Loading branch information
peterdettman committed Apr 2, 2020
1 parent 6b69f3b commit aff5122
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.bouncycastle.pqc.crypto.test;

import java.math.BigInteger;
import java.security.SecureRandom;

import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
import org.bouncycastle.crypto.CryptoServicesRegistrar;
Expand All @@ -21,19 +20,11 @@
import org.bouncycastle.pqc.crypto.gmss.GMSSStateAwareSigner;
import org.bouncycastle.util.BigIntegers;
import org.bouncycastle.util.Strings;
import org.bouncycastle.util.encoders.Hex;
import org.bouncycastle.util.test.FixedSecureRandom;
import org.bouncycastle.util.test.SimpleTest;


public class GMSSSignerTest
extends SimpleTest
{
byte[] keyData = Hex.decode("b5014e4b60ef2ba8b6211b4062ba3224e0427dd3");

SecureRandom keyRandom = new FixedSecureRandom(
new FixedSecureRandom.Source[]{new FixedSecureRandom.Data(keyData), new FixedSecureRandom.Data(keyData)});

public String getName()
{
return "GMSS";
Expand All @@ -42,7 +33,6 @@ public String getName()
public void performTest()
throws Exception
{

GMSSParameters params = new GMSSParameters(3,
new int[]{15, 15, 10}, new int[]{5, 5, 4}, new int[]{3, 3, 2});

Expand All @@ -56,15 +46,15 @@ public Digest get()

GMSSKeyPairGenerator gmssKeyGen = new GMSSKeyPairGenerator(digProvider);

GMSSKeyGenerationParameters genParam = new GMSSKeyGenerationParameters(keyRandom, params);
GMSSKeyGenerationParameters genParam = new GMSSKeyGenerationParameters(null, params);

gmssKeyGen.init(genParam);

AsymmetricCipherKeyPair pair = gmssKeyGen.generateKeyPair();

GMSSPrivateKeyParameters privKey = (GMSSPrivateKeyParameters)pair.getPrivate();

ParametersWithRandom param = new ParametersWithRandom(privKey, keyRandom);
ParametersWithRandom param = new ParametersWithRandom(privKey, null);

// TODO
Signer gmssSigner = new DigestingMessageSigner(new GMSSSigner(digProvider), new SHA224Digest());
Expand Down

0 comments on commit aff5122

Please sign in to comment.