diff --git a/crypto/src/pqc/crypto/crystals/dilithium/DilithiumEngine.cs b/crypto/src/pqc/crypto/crystals/dilithium/DilithiumEngine.cs
index b5ac413e4..9b6479eaf 100644
--- a/crypto/src/pqc/crypto/crystals/dilithium/DilithiumEngine.cs
+++ b/crypto/src/pqc/crypto/crystals/dilithium/DilithiumEngine.cs
@@ -17,7 +17,6 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium
public const int RootOfUnity = 1753;
public const int SeedBytes = 32;
public const int CrhBytes = 64;
- public const bool RandomizedSigning = false;
public const int PolyT1PackedBytes = 320;
public const int PolyT0PackedBytes = 416;
@@ -185,7 +184,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium
ShakeDigest256.BlockUpdate(msg, 0, msglen);
ShakeDigest256.DoFinal(mu, 0, CrhBytes);
- if (RandomizedSigning)
+ if (_random != null)
{
_random.NextBytes(rhoPrime);
}
diff --git a/crypto/src/pqc/crypto/crystals/dilithium/DilithiumSigner.cs b/crypto/src/pqc/crypto/crystals/dilithium/DilithiumSigner.cs
index 98b19ff3e..58b9d1803 100644
--- a/crypto/src/pqc/crypto/crystals/dilithium/DilithiumSigner.cs
+++ b/crypto/src/pqc/crypto/crystals/dilithium/DilithiumSigner.cs
@@ -12,9 +12,8 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium
private SecureRandom random;
- public DilithiumSigner(SecureRandom random)
+ public DilithiumSigner()
{
- this.random = random;
}
public void Init(bool forSigning, ICipherParameters param)
@@ -22,15 +21,15 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium
if (forSigning)
{
if (param is ParametersWithRandom)
- {
+ {
privKey = (DilithiumPrivateKeyParameters)((ParametersWithRandom)param).Parameters;
random = ((ParametersWithRandom)param).Random;
}
else
- {
- privKey = (DilithiumPrivateKeyParameters)param;
- random = new SecureRandom();
- }
+ {
+ privKey = (DilithiumPrivateKeyParameters)param;
+ random = null;
+ }
}
else
{
diff --git a/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs b/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs
index fc26f3c5f..351fc9140 100644
--- a/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs
+++ b/crypto/test/src/pqc/crypto/test/CrystalsDilithiumTest.cs
@@ -60,7 +60,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests
AsymmetricCipherKeyPair kp = kpGen.GenerateKeyPair();
- DilithiumSigner signer = new DilithiumSigner(random);
+ DilithiumSigner signer = new DilithiumSigner();
signer.Init(true, kp.Private);
@@ -112,7 +112,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Tests
//
// Signature test
//
- DilithiumSigner signer = new DilithiumSigner(random);
+ DilithiumSigner signer = new DilithiumSigner();
signer.Init(true, privParams);
byte[] sigGenerated = signer.GenerateSignature(msg);
|