[BACK]Return to gfs.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / engine

Diff for /OpenXM_contrib2/asir2000/engine/gfs.c between version 1.12 and 1.15

version 1.12, 2002/09/27 08:40:49 version 1.15, 2003/01/06 01:16:39
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  *   *
  * $OpenXM: OpenXM_contrib2/asir2000/engine/gfs.c,v 1.11 2002/09/27 04:24:04 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/engine/gfs.c,v 1.14 2002/12/18 06:15:40 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "inline.h"  #include "inline.h"
Line 661  int mulremum_enc(int p,int n,UM dp,int a,int b)
Line 661  int mulremum_enc(int p,int n,UM dp,int a,int b)
   
 void gfs_galois_action(GFS a,Q e,GFS *c)  void gfs_galois_action(GFS a,Q e,GFS *c)
 {  {
         Q q;          Q p;
         int i,k;          int i,k;
         GFS t,s;          GFS t,s;
   
         t = a;          t = a;
         k = QTOS(e);          k = QTOS(e);
         STOQ(current_gfs_q,q);          STOQ(current_gfs_p,p);
         for ( i = 0; i < k; i++ ) {          for ( i = 0; i < k; i++ ) {
                 pwrgfs(t,q,&s); t = s;                  pwrgfs(t,p,&s); t = s;
         }          }
         *c = t;          *c = t;
 }  }
Line 944  int cmpgfs(GFS a,GFS b)
Line 944  int cmpgfs(GFS a,GFS b)
                 }                  }
 }  }
   
   void pthrootgfs(GFS a,GFS *b)
   {
           Q p;
           int e,i;
           GFS t,s;
   
           STOQ(characteristic_sf(),p);
           e = extdeg_sf()-1;
           t = a;
           for ( i = 0; i < e; i++ ) {
                   pwrgfs(t,p,&s); t = s;
           }
           *b = t;
   }
   
 void randomgfs(GFS *r)  void randomgfs(GFS *r)
 {  {
         unsigned int t;          unsigned int t;
Line 1117  int _itosf(int n)
Line 1132  int _itosf(int n)
 {  {
         int i;          int i;
   
           /* XXX */
   #if 0
         n %= current_gfs_p;          n %= current_gfs_p;
   #else
           n %= current_gfs_q;
   #endif
         if ( !n )          if ( !n )
                 return 0;                  return 0;
         i = !current_gfs_ntoi ? n : current_gfs_ntoi[n];          i = !current_gfs_ntoi ? n : current_gfs_ntoi[n];

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.15

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>