diff options
| author | J08nY | 2017-02-15 20:44:20 +0100 |
|---|---|---|
| committer | J08nY | 2017-02-15 20:44:20 +0100 |
| commit | 4190b8e35a781a08f1749448f51cb4ea798f5588 (patch) | |
| tree | 3d162b7c6124dd4bb477b3830c5acae152f5fb3e /src | |
| parent | 69bfdc6a4584a22dac7525f38c8ac013f05417b6 (diff) | |
| download | ecgen-4190b8e35a781a08f1749448f51cb4ea798f5588.tar.gz ecgen-4190b8e35a781a08f1749448f51cb4ea798f5588.tar.zst ecgen-4190b8e35a781a08f1749448f51cb4ea798f5588.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/gp/gp.gp | 5 | ||||
| -rw-r--r-- | src/gp/invalid.gp | 59 | ||||
| -rw-r--r-- | src/gp/utils.gp | 19 |
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 |
