Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/java/org/bouncycastle/crypto/agreement/test/JPAKEPrimeOrderGroupTest.java')
-rw-r--r--core/src/test/java/org/bouncycastle/crypto/agreement/test/JPAKEPrimeOrderGroupTest.java85
1 files changed, 0 insertions, 85 deletions
diff --git a/core/src/test/java/org/bouncycastle/crypto/agreement/test/JPAKEPrimeOrderGroupTest.java b/core/src/test/java/org/bouncycastle/crypto/agreement/test/JPAKEPrimeOrderGroupTest.java
deleted file mode 100644
index 7d22f16a..00000000
--- a/core/src/test/java/org/bouncycastle/crypto/agreement/test/JPAKEPrimeOrderGroupTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.bouncycastle.crypto.agreement.test;
-
-import java.math.BigInteger;
-
-import junit.framework.TestCase;
-import org.bouncycastle.crypto.CryptoException;
-import org.bouncycastle.crypto.agreement.jpake.JPAKEPrimeOrderGroup;
-
-public class JPAKEPrimeOrderGroupTest
- extends TestCase
-{
-
- public void testConstruction()
- throws CryptoException
- {
- // p-1 not evenly divisible by q
- try
- {
- new JPAKEPrimeOrderGroup(BigInteger.valueOf(7), BigInteger.valueOf(5), BigInteger.valueOf(6));
- fail();
- }
- catch (IllegalArgumentException e)
- {
- // pass
- }
-
- // g < 2
- try
- {
- new JPAKEPrimeOrderGroup(BigInteger.valueOf(11), BigInteger.valueOf(5), BigInteger.valueOf(1));
- fail();
- }
- catch (IllegalArgumentException e)
- {
- // pass
- }
-
- // g > p-1
- try
- {
- new JPAKEPrimeOrderGroup(BigInteger.valueOf(11), BigInteger.valueOf(5), BigInteger.valueOf(11));
- fail();
- }
- catch (IllegalArgumentException e)
- {
- // pass
- }
-
- // g^q mod p not equal 1
- try
- {
- new JPAKEPrimeOrderGroup(BigInteger.valueOf(11), BigInteger.valueOf(5), BigInteger.valueOf(6));
- fail();
- }
- catch (IllegalArgumentException e)
- {
- // pass
- }
-
- // p not prime
- try
- {
- new JPAKEPrimeOrderGroup(BigInteger.valueOf(15), BigInteger.valueOf(2), BigInteger.valueOf(4));
- fail();
- }
- catch (IllegalArgumentException e)
- {
- // pass
- }
-
- // q not prime
- try
- {
- new JPAKEPrimeOrderGroup(BigInteger.valueOf(7), BigInteger.valueOf(6), BigInteger.valueOf(3));
- fail();
- }
- catch (IllegalArgumentException e)
- {
- // pass
- }
-
- // should succeed
- new JPAKEPrimeOrderGroup(BigInteger.valueOf(7), BigInteger.valueOf(3), BigInteger.valueOf(4));
- }
-}