1 // tlss.h: definition of class TLSS for sieving E(Q)/pE(Q) at one prime q 2 ////////////////////////////////////////////////////////////////////////// 3 // 4 // Copyright 1990-2012 John Cremona 5 // 6 // This file is part of the eclib package. 7 // 8 // eclib is free software; you can redistribute it and/or modify it 9 // under the terms of the GNU General Public License as published by the 10 // Free Software Foundation; either version 2 of the License, or (at your 11 // option) any later version. 12 // 13 // eclib is distributed in the hope that it will be useful, but WITHOUT 14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 16 // for more details. 17 // 18 // You should have received a copy of the GNU General Public License 19 // along with eclib; if not, write to the Free Software Foundation, 20 // Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 21 // 22 ////////////////////////////////////////////////////////////////////////// 23 24 25 // NB: TLSS = Tate--Lichtenbaum--Samir-Siksek: we use a simple 26 // discrete log a la Siksek when the p-torsion in E(F_q) is cyclic, 27 // else use the Tate-Lichtenbaum pairing 28 29 // allow for multiple includes 30 #ifndef _ECLIB_TLSS_ 31 #define _ECLIB_TLSS_ 32 33 #include <eclib/matrix.h> 34 #include <eclib/ffmod.h> 35 36 class TLSS { 37 private: 38 int p; // the prime to saturate at. 39 int rank; // p-rank of E mod q (0,1,2) 40 bigint q; // the modulus 41 bigint q1p; // = (q-1)/p; 42 43 galois_field Fq; // F_q 44 vector<gf_element> mu_p; // all p'th roots mod q 45 curvemodqbasis Emodq; // E over F_q (including its structure) 46 vector<pointmodq> Pi; // basis for p-torsion of E(F_q) (length = rank = 0,1,2) 47 vector<ffmodq> TLpolys; // in the function field Fq(E) 48 int verbose; 49 void init_tlpolys(void); 50 51 public: TLSS(void)52 TLSS(void) :Emodq() {;} assign(const curvemodqbasis & E)53 void assign(const curvemodqbasis& E) {Emodq=E; Fq=get_field(Emodq); q=Fq.characteristic(); } 54 void init(int pp, int verb=0); 55 void init(int pp, const ZPoly& pdivpol, int verb=0); ~TLSS()56 ~TLSS() {; } 57 58 // apply map to P, result in (ntp*)[0..p-1]: 59 vector<int> map1point(const Point& P) const; 60 // apply map to all P in Plist, result is a (ntp*#Plist) matrix: 61 mat_l map_points(const vector<Point>& Plist) const; 62 // give the current p-rank get_rank()63 int get_rank() const {return rank;} 64 65 }; 66 67 68 #endif // #define _TLSS_ 69