diff options
| author | J08nY | 2017-02-05 03:59:52 +0100 |
|---|---|---|
| committer | J08nY | 2017-02-05 03:59:52 +0100 |
| commit | 763fc80153c5e9287f1b0f0609b11fb4f50c90ab (patch) | |
| tree | 5cd6e7acc4512cca65bcc16a74f3b63879b2d3bc /points.gp | |
| parent | 3d9bf583ccc5eea61c5f78f52d1e2073daee924c (diff) | |
| download | ecgen-0.2.0.tar.gz ecgen-0.2.0.tar.zst ecgen-0.2.0.zip | |
Diffstat (limited to 'points.gp')
| -rw-r--r-- | points.gp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/points.gp b/points.gp deleted file mode 100644 index 428704e..0000000 --- a/points.gp +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Finds random point of order n on curve e of order o. - * @returns [[P.x, P.y], n, h] - * @param e curve - * @param o curve order - * @param n desired point order - */ -find_point(e, o, n) = { - local(h, P); - h = o\n; - until(ellmul(e, P, n), - P = random(e); - ); - return([P, n, h]); -} - -/** - * Finds random points of orders given by vector p. - * @returns vector of points in format [[P.x, P.y], n, h] - * @param e curve - * @param o curve order - * @param p vector of point orders - */ -find_points(e, o, p) = { - return(vector(length(p),X,find_point(e, o, p[X]))); -} - -/*####################################################################*/ - -maxprime_order(e, o) = { - if(isprime(o), - return(o); - , - return(vecmax(factor(o))); - ); -} - -minprime_order(e, o) = { - if(isprime(o), - return(o); - , - return(factor(o)[1,1]); - ); -} - -/*####################################################################*/ - -prime_orders(e, o) = { - local(f); - if(isprime(o), - return([o]); - , - f = factor(o); - return(vector(length(f),X,f[X,1])); - ); -} |
