summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2024-03-12 22:12:34 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2024-03-12 22:12:34 +0700
commitb1dfe0eab304f9d516d1d95d2211b1eaf8b9d2e8 (patch)
treec599b23754451dbf207ea13f2f7b245104de9cfa
parentUse TryFromID to check for OID string (diff)
downloadBouncyCastle.NET-ed25519-b1dfe0eab304f9d516d1d95d2211b1eaf8b9d2e8.tar.xz
Refactor some test cases
-rw-r--r--crypto/test/src/math/test/BigIntegerTest.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/test/src/math/test/BigIntegerTest.cs b/crypto/test/src/math/test/BigIntegerTest.cs
index 88ac7151e..887f2f35c 100644
--- a/crypto/test/src/math/test/BigIntegerTest.cs
+++ b/crypto/test/src/math/test/BigIntegerTest.cs
@@ -941,7 +941,7 @@ namespace Org.BouncyCastle.Math.Tests
 
             for (int i = 16; i <= 48; ++i)
             {
-                BigInteger x = BigInteger.ProbablePrime(i, random);
+                BigInteger x = new BigInteger(i, random).SetBit(i - 1);
                 byte[] b = x.ToByteArray();
                 Assert.AreEqual((i / 8 + 1), b.Length);
                 BigInteger y = new BigInteger(b);
@@ -963,7 +963,7 @@ namespace Org.BouncyCastle.Math.Tests
 
             for (int i = 16; i <= 48; ++i)
             {
-                BigInteger x = BigInteger.ProbablePrime(i, random);
+                BigInteger x = new BigInteger(i, random).SetBit(i - 1);
                 byte[] b = x.ToByteArrayUnsigned();
                 Assert.AreEqual((i + 7) / 8, b.Length);
                 BigInteger y = new BigInteger(1, b);