diff options
| author | J08nY | 2017-02-09 04:07:37 +0100 |
|---|---|---|
| committer | J08nY | 2017-02-09 04:07:37 +0100 |
| commit | 79b29481b1c4d13063dd8b6ee6a1d0d70a54faab (patch) | |
| tree | 007da84bc4133c656f2f66df541f74c6b55bfb11 /src/gp | |
| parent | 0b5d1cca9c78869c6cffa2932297c1d70ba142e2 (diff) | |
| download | ecgen-79b29481b1c4d13063dd8b6ee6a1d0d70a54faab.tar.gz ecgen-79b29481b1c4d13063dd8b6ee6a1d0d70a54faab.tar.zst ecgen-79b29481b1c4d13063dd8b6ee6a1d0d70a54faab.zip | |
Seperated different generation methods into modules.
- Added Koblitz curve generation.
Diffstat (limited to 'src/gp')
| -rw-r--r-- | src/gp/equation.gp | 28 | ||||
| -rw-r--r-- | src/gp/field.gp | 33 |
2 files changed, 0 insertions, 61 deletions
diff --git a/src/gp/equation.gp b/src/gp/equation.gp deleted file mode 100644 index c1483e4..0000000 --- a/src/gp/equation.gp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * ecgen, tool for generating Elliptic curve domain parameters - * Copyright (C) 2017 J08nY - */ - -/** - * Constructs an elliptic curve in the form E: - * y^2 = x^3 + ax + b, over a prime field - * @param a - * @param b - * @param p - * @returns elliptic curve - */ -prime_weierstrass(a:int, b:int, field:gen) = { - return(ellinit([a,b], field)); -} - -/** - * Constructs an elliptic curve in the form E: - * y^2 + xy = x^3 + ax + b, over a binary field. - * @param a - * @param b - * @param field - * @returns elliptic curve - */ -binary_weierstrass(a:int, b:int, field:gen) = { - return(ellinit([1,0,0,a,b], field)); -} diff --git a/src/gp/field.gp b/src/gp/field.gp deleted file mode 100644 index c428abd..0000000 --- a/src/gp/field.gp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * ecgen, tool for generating Elliptic curve domain parameters - * Copyright (C) 2017 J08nY - */ - -/** - * Extract a field representation from a field. - * - char(field) == 2: - * returns the vector of powers of middle coefficients of the reduction polynomial. - * - char(field) != 2: - * returns the field characteristic(p). - * - * @return field representation - */ -field_params(field:gen) = { - if(type(field) == "t_INT", - return([field]); - ); - - local(out:vec, j:int, c:int); - out = vector(3); - - j = 1; - for(i=2, length(field.mod) - 2, - c = polcoeff(field.mod, i):int; - if(c != 0, - out[j] = i; - j++; - ); - ); - - return(out); -}
\ No newline at end of file |
