Hi,
I’m trying to figure out how to use BC ECCurve.FP to construct a supersingular elliptic curve over F_p
The definition of the curve is a follows:
An elliptic curve defined over F_p, having a subgroup of order
q. with equation y^2 = x^3 - 3 * x modulo p
The parameters of curve are provided as well including p, q, Px, Py and g
I tried doing something like this:
ECCurve curve = new ECCurve.Fp(p, ECConstants.THREE.negate(),
ECConstants.ZERO, q, ECConstants.ONE);
However the negative coefficient is causing an exception to be thrown.
Caused by: java.lang.IllegalArgumentException: x value invalid in Fp field element
at org.bouncycastle.math.ec.ECFieldElement$Fp.<init>(Unknown Source)
at org.bouncycastle.math.ec.ECCurve$Fp.fromBigInteger(Unknown Source)
at org.bouncycastle.math.ec.ECCurve$Fp.<init>(Unknown Source)
So there are two questions.
- is it possible to create this curve with Bouncy Castle?
- If so, any guidance would be appreciated
I’m using Bouncy Castle version 1.61
Thanks