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
path: root/core
diff options
context:
space:
mode:
authorDavid Hook <dgh@cryptoworkshop.com>2014-06-28 08:45:51 +0400
committerDavid Hook <dgh@cryptoworkshop.com>2014-06-28 08:45:51 +0400
commit0a698b5d94e064edeef78bf9e3b83cf17071c0e5 (patch)
treeecbebc8cc8db9c8bfcb1ae4bfd90054a2e18061a /core
parent0f1ecad50a46b0085d6f4be8b6d2aac480989f80 (diff)
update
Diffstat (limited to 'core')
-rw-r--r--core/src/test/java/org/bouncycastle/math/ec/test/ECPointPerformanceTest.java21
-rw-r--r--core/src/test/java/org/bouncycastle/math/ec/test/ECPointTest.java21
2 files changed, 34 insertions, 8 deletions
diff --git a/core/src/test/java/org/bouncycastle/math/ec/test/ECPointPerformanceTest.java b/core/src/test/java/org/bouncycastle/math/ec/test/ECPointPerformanceTest.java
index a5e45dab..6db88a00 100644
--- a/core/src/test/java/org/bouncycastle/math/ec/test/ECPointPerformanceTest.java
+++ b/core/src/test/java/org/bouncycastle/math/ec/test/ECPointPerformanceTest.java
@@ -2,15 +2,16 @@ package org.bouncycastle.math.ec.test;
import java.math.BigInteger;
import java.security.SecureRandom;
-import java.util.Collections;
+import java.util.ArrayList;
+import java.util.Enumeration;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import junit.framework.TestCase;
-
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.asn1.x9.ECNamedCurveTable;
import org.bouncycastle.asn1.x9.X9ECParameters;
@@ -173,8 +174,8 @@ public class ECPointPerformanceTest extends TestCase
public void testMultiply() throws Exception
{
- SortedSet names = new TreeSet(Collections.list(ECNamedCurveTable.getNames()));
- names.addAll(Collections.list(CustomNamedCurves.getNames()));
+ SortedSet names = new TreeSet(enumToList(ECNamedCurveTable.getNames()));
+ names.addAll(enumToList(CustomNamedCurves.getNames()));
Set oids = new HashSet();
@@ -195,4 +196,16 @@ public class ECPointPerformanceTest extends TestCase
randMult(name);
}
}
+
+ private List enumToList(Enumeration en)
+ {
+ List rv = new ArrayList();
+
+ while (en.hasMoreElements())
+ {
+ rv.add(en.nextElement());
+ }
+
+ return rv;
+ }
}
diff --git a/core/src/test/java/org/bouncycastle/math/ec/test/ECPointTest.java b/core/src/test/java/org/bouncycastle/math/ec/test/ECPointTest.java
index 4db9f4bd..1ad4d760 100644
--- a/core/src/test/java/org/bouncycastle/math/ec/test/ECPointTest.java
+++ b/core/src/test/java/org/bouncycastle/math/ec/test/ECPointTest.java
@@ -2,15 +2,16 @@ package org.bouncycastle.math.ec.test;
import java.math.BigInteger;
import java.security.SecureRandom;
-import java.util.Collections;
+import java.util.ArrayList;
+import java.util.Enumeration;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-
import org.bouncycastle.asn1.x9.ECNamedCurveTable;
import org.bouncycastle.asn1.x9.X9ECParameters;
import org.bouncycastle.crypto.ec.CustomNamedCurves;
@@ -503,8 +504,8 @@ public class ECPointTest extends TestCase
*/
public void testAddSubtractMultiplyTwiceEncoding()
{
- Set names = new HashSet(Collections.list(ECNamedCurveTable.getNames()));
- names.addAll(Collections.list(CustomNamedCurves.getNames()));
+ Set names = new HashSet(enumToList(ECNamedCurveTable.getNames()));
+ names.addAll(enumToList(CustomNamedCurves.getNames()));
Iterator it = names.iterator();
while (it.hasNext())
@@ -525,6 +526,18 @@ public class ECPointTest extends TestCase
}
}
+ private List enumToList(Enumeration en)
+ {
+ List rv = new ArrayList();
+
+ while (en.hasMoreElements())
+ {
+ rv.add(en.nextElement());
+ }
+
+ return rv;
+ }
+
private void assertPointsEqual(String message, ECPoint a, ECPoint b)
{
assertEquals(message, a, b);