aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gp/gp.gp5
-rw-r--r--src/gp/invalid.gp59
-rw-r--r--src/gp/utils.gp19
3 files changed, 0 insertions, 83 deletions
diff --git a/src/gp/gp.gp b/src/gp/gp.gp
index c6f9494..7fa5fd0 100644
--- a/src/gp/gp.gp
+++ b/src/gp/gp.gp
@@ -2,8 +2,3 @@
* ecgen, tool for generating Elliptic curve domain parameters
* Copyright (C) 2017 J08nY
*/
-
-/*
-\r gp/utils
-\r gp/invalid
-*/
diff --git a/src/gp/invalid.gp b/src/gp/invalid.gp
deleted file mode 100644
index 4970014..0000000
--- a/src/gp/invalid.gp
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * ecgen, tool for generating Elliptic curve domain parameters
- * Copyright (C) 2017 J08nY
- */
-
-/**
- * Computes primes upto some upper bound.
- *
- * @param bound an upper bound on primes
- * @return a vector of primes up to bound^2
- */
-prime_upto(bound:int) = {
- local(p:list, product:int, last:int, result:vec);
- p = List();
-
- bound = bound^2;
- listput(p, 2);
- product = 2;
- last = 2;
-
- while(product < bound,
- last = nextprime(last + 1);
- listput(p, last);
- product = product * last;
- );
-
- result = list_to_vec(p);
- listkill(p);
- return(result);
-}
-
-/**
- *
- */
-invalid(coeffs:vec, field:pol, primes:vec, bits:int) = {
- local(bs:vec, cs:vec, eq:vec, e:ell, b, n, c, o):int;
- n = length(primes);
- bs = vector(n);
- eq = coeffs;
- c = 0;
-
- while(c < n,
- b = random_int(bits):int;
- eq[4] = b; /* Times field? */
-
- iferr(e = ellinit(eq,field):ell, E, next());
-
- o = ellsea(e):int;
- for(i=1,n,
- if((o % primes[i]) == 0 && bs[i] == 0,
- bs[i] = b;
- cs[i] = e;
- c = c + 1;
- );
- );
- );
-
- return(cs);
-} \ No newline at end of file
diff --git a/src/gp/utils.gp b/src/gp/utils.gp
deleted file mode 100644
index 0f29394..0000000
--- a/src/gp/utils.gp
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * ecgen, tool for generating Elliptic curve domain parameters
- * Copyright (C) 2017 J08nY
- */
-/**
- * Converts a list to a vector.
- *
- * @param l list to convert
- * @return a vector of the lists values
- */
-list_to_vec(l:list) = {
- local(v:vec, n:int);
- n = length(l);
- v = vector(n);
- for(i=1, n,
- v[i] = l[i];
- );
- return(v);
-} \ No newline at end of file