using ECCurve.FP for a supersingular curve

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

using ECCurve.FP for a supersingular curve

PaulH

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.ZEROq, 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.

  1. is it possible to create this curve with Bouncy Castle?
  2. If so, any guidance would be appreciated  

 

 

I’m using Bouncy Castle version 1.61

 

Thanks

Reply | Threaded
Open this post in threaded view
|

Re: using ECCurve.FP for a supersingular curve

Peter Dettman-3
Hi Paul,

On 14/6/19 10:14 pm, Haggerty, Paul wrote:
> Hi,
>
> I’m trying to figure out how to use  BC ECCurve.FP  to construct a
> supersingular elliptic curve over F_p
<snip>
> However the negative coefficient is causing an exception to be thrown.
>
> Caused by: java.lang.IllegalArgumentException: x value invalid in Fp
> field element

It needs a non-negative number, so instead of THREE.negate(), use
p.subtract(THREE) (i.e. -3 mod p).


> So there are two questions.
>
>  1. is it possible to create this curve with Bouncy Castle?
>  2. If so, any guidance would be appreciated  

It should work fine, just ask again if you run into further trouble.

Regards,
Pete Dettman