# While generating a random Elliptic curve what are the conditions i have to considerd?

1. I want to generate a random elliptic curve over a prime field. What are the conditions I should satisfy?

2. For the NIST recommended standard ECC-224 bit curve with prime $p=2^{224}-2^{96}+1$, a reduction technique is given by $(z_1+z_2+z_3-z_4-z_5) \bmod{p}$, what is the logic behind in this?

-

Just checking, you want to generate a curve or a point on a curve? A curve over a finite field or infinite or either? – mikeazo♦ Feb 28 at 14:04
i want to generate a random curve over prime field... – venkat Mar 1 at 15:43
I don't understand question #2 at all. Can you help me understand? – mikeazo♦ Mar 1 at 15:59
NIST recommended standard ECC-224 bit, prime value is 2^224-2^96+1. 224 bit * 224 bit multiplication results 448 bit output. which can be converted back over field 224 bit, NIST standard has given one formula ((z1+z2+z3-z4-z5) mod prime )). what is mathematical logic beind in this formula. – venkat Mar 2 at 14:36
I have updated the question to make #2 a little better. Can you make sure I didn't change the meaning? Also, what are the $z$ values? – mikeazo♦ Mar 3 at 13:43
show 1 more comment

## 2 Answers

There are several conditions that might need to be satisfied, depending on your needs. At a bare minimum the curve you generate needs to have a large prime subgroup. To determine this one can use any number of point counting algorithms, or alternatively use the complex multiplication method to generate a curve with the desired number of points.

Beyond large prime subgroup you may also want the twist to have a large prime subgroup to avoid attacks based on sending points on the twist. Point validation is another way to avoid them.

Sometimes a specific cofactor is required for certain parametrizations of the curve that can lead to more efficient calculations.

For details you can see DJB's analysis of his choices for Curve25519, as well as papers cited by the Explicit Formula Database. http://hyperelliptic.org/EFD/bib.html

-

Baring other requirements that you did not explain:

An elliptic curve can be written as $y^2=x^3+ax+b$. To generate a random curve over a prime field, choose $a,b$ at random from the prime field.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 5, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9121452569961548, "perplexity_flag": "middle"}