# Finding of proper $d$ for Edward curve

I wanna create the safe Twisted Edward curve. As far as I know, The number of curve points must be $$\#E=8r$$ that $$r$$ is big prime number. Also the number of points of quadratic twist of this curve must be $$\#E'=4r'$$ that $$r'$$ is big prime number. I search the value of $$d$$ for $$-x^2+y^2=1+dx^2y^2$$ that satisfices these properties. I know that $$d$$ must be nonquadratic number in $$F_p$$ and $$p=1 \ mod(4)$$.I had ran the sage app for finding proper $$d$$ for almost three months. But The program hasn't find this yet.

Are there any efficient ways for finding proper $$d$$? What happen If my curve isn't the quadratic twist secure? Are there any way that I set the $$r$$ and create the curve fit to it?

• Isn't that a duplicate of this? The answers and comments there may help. What the present question means by "ran the sage app" is unclear (analogy: "used pump"). Rather than running the same thing for 3 months, the bare minimum is to explore for small parameters, determine how the runtime evolves w.r.t. field order, and get a ballpark figure of what you are headed to.
– fgrieu
Commented Jun 28, 2021 at 6:31
• Sage is the mathematical application. I search proper $d$ for my own prim number $p$ not for previous standard curves. My question is how to choose the value of d that passes security requirements. Commented Jun 28, 2021 at 11:26
• Sage may be too slow for this. See the answer that fgrieu linked to. Also, are you sure your script is correct? Is it able to find the 25519 curve? For reference, with Pari/GP it took me ~10h to find a new curve. Commented Jun 28, 2021 at 12:31
• Yes. I am sure. I tested it several times. My security level is 256 bit. It means that the number of prime bits is 512. The most time expended in the counting of a number of curve points. The script is as this. It counts the points of the curve for any selected $d$. Then checks that pass the security aspects. Commented Jun 28, 2021 at 16:17