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:
authorDavid Hook <dgh@cryptoworkshop.com>2014-01-05 11:34:37 +0400
committerDavid Hook <dgh@cryptoworkshop.com>2014-01-05 11:34:37 +0400
commitf3fac8898e6557b5d3fd403c833a1db791c044d1 (patch)
tree0514ef0715ea1e2489e4e25ce64a7420a6e41022
parent33166ea1406a0dc0f7eb64ababe3733830763b6b (diff)
Further work on custom curves.
-rw-r--r--core/src/main/java/org/bouncycastle/asn1/x9/X9ECParameters.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/src/main/java/org/bouncycastle/asn1/x9/X9ECParameters.java b/core/src/main/java/org/bouncycastle/asn1/x9/X9ECParameters.java
index 60f90081..f0d14a52 100644
--- a/core/src/main/java/org/bouncycastle/asn1/x9/X9ECParameters.java
+++ b/core/src/main/java/org/bouncycastle/asn1/x9/X9ECParameters.java
@@ -11,6 +11,8 @@ import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.DERSequence;
import org.bouncycastle.math.ec.ECCurve;
import org.bouncycastle.math.ec.ECPoint;
+import org.bouncycastle.math.ec.custom.sec.SecP256K1Curve;
+import org.bouncycastle.math.ec.custom.sec.SecP256R1Curve;
/**
* ASN.1 def for Elliptic-Curve ECParameters structure. See
@@ -112,6 +114,15 @@ public class X9ECParameters
{
this.fieldID = new X9FieldID(((ECCurve.Fp)curve).getQ());
}
+ // TODO: need a better indicator for a custom curve
+ else if (curve instanceof SecP256R1Curve)
+ {
+ this.fieldID = new X9FieldID(((SecP256R1Curve)curve).getQ());
+ }
+ else if (curve instanceof SecP256K1Curve)
+ {
+ this.fieldID = new X9FieldID(((SecP256K1Curve)curve).getQ());
+ }
else
{
if (curve instanceof ECCurve.F2m)