version 1.4, 2001/05/09 01:41:42 |
version 1.5, 2001/09/03 07:01:06 |
|
|
* 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/up_lm.c,v 1.3 2000/08/22 05:04:07 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/engine/up_lm.c,v 1.4 2001/05/09 01:41:42 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include <math.h> |
#include <math.h> |
|
|
N n; |
N n; |
UP x,y,t,invf,s; |
UP x,y,t,invf,s; |
int k; |
int k; |
LM lm; |
|
GFS fs; |
|
Num c; |
Num c; |
struct oEGT eg_sq,eg_rem,eg_mul,eg_inv,eg0,eg1,eg2,eg3; |
struct oEGT eg_sq,eg_rem,eg_mul,eg_inv,eg0,eg1,eg2,eg3; |
|
|
if ( !current_ff ) |
if ( !current_ff ) |
error("powermodup : current_ff is not set"); |
error("powermodup : current_ff is not set"); |
field_order_ff(&n); |
field_order_ff(&n); |
switch ( current_ff ) { |
one_ff(&c); |
case FF_GFP: |
|
case FF_GFPN: |
|
MKLM(ONEN,lm); |
|
c = (Num)lm; |
|
break; |
|
case FF_GFS: |
|
mqtogfs(ONEM,&fs); |
|
c = (Num)fs; |
|
break; |
|
default: |
|
error("powermodup : not implemented yet"); |
|
} |
|
x = UPALLOC(1); x->d = 1; x->c[1] = c; |
x = UPALLOC(1); x->d = 1; x->c[1] = c; |
y = UPALLOC(0); y->d = 0; y->c[0] = c; |
y = UPALLOC(0); y->d = 0; y->c[0] = c; |
|
|
|
|
uptolmup(s,&invf); |
uptolmup(s,&invf); |
break; |
break; |
case FF_GFS: |
case FF_GFS: |
|
case FF_GFSN: |
invf = s; /* XXX */ |
invf = s; /* XXX */ |
break; |
break; |
default: |
default: |
|
|
N e; |
N e; |
UP x,y,t,invf,s; |
UP x,y,t,invf,s; |
int k; |
int k; |
LM lm; |
|
GFS fs; |
|
Num c; |
Num c; |
struct oEGT eg_sq,eg_rem,eg_mul,eg_inv,eg0,eg1,eg2,eg3; |
struct oEGT eg_sq,eg_rem,eg_mul,eg_inv,eg0,eg1,eg2,eg3; |
|
|
e = NM(d); |
e = NM(d); |
switch ( current_ff ) { |
one_ff(&c); |
case FF_GFP: |
|
case FF_GFPN: |
|
MKLM(ONEN,lm); |
|
c = (Num)lm; |
|
break; |
|
case FF_GFS: |
|
mqtogfs(ONEM,&fs); |
|
c = (Num)fs; |
|
break; |
|
default: |
|
error("generic_powermodup : not implemented yet"); |
|
} |
|
y = UPALLOC(0); y->d = 0; y->c[0] = c; |
y = UPALLOC(0); y->d = 0; y->c[0] = c; |
remup(g,f,&x); |
remup(g,f,&x); |
if ( !x ) { |
if ( !x ) { |
|
|
{ |
{ |
UP y,t,invf; |
UP y,t,invf; |
int i,d; |
int i,d; |
LM lm; |
|
GFS fs; |
|
Num c; |
Num c; |
struct oEGT eg_rem,eg_mul,eg0,eg1,eg2; |
struct oEGT eg_rem,eg_mul,eg0,eg1,eg2; |
|
|
d = f->d; |
d = f->d; |
switch ( current_ff ) { |
one_ff(&c); |
case FF_GFP: |
|
case FF_GFPN: |
|
MKLM(ONEN,lm); |
|
c = (Num)lm; |
|
break; |
|
case FF_GFS: |
|
mqtogfs(ONEM,&fs); |
|
c = (Num)fs; |
|
break; |
|
default: |
|
error("powertabup : not implemented yet"); |
|
} |
|
y = UPALLOC(0); y->d = 0; y->c[0] = c; |
y = UPALLOC(0); y->d = 0; y->c[0] = c; |
tab[0] = y; |
tab[0] = y; |
tab[1] = xp; |
tab[1] = xp; |