version 1.4, 2000/08/22 05:03:57 |
version 1.5, 2001/10/09 01:36:05 |
|
|
* 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/builtin/ec.c,v 1.3 2000/08/21 08:31:19 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/ec.c,v 1.4 2000/08/22 05:03:57 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 270 void Pecm_compute_all_key_homo_ff(arg,rp) |
|
Line 270 void Pecm_compute_all_key_homo_ff(arg,rp) |
|
NODE arg; |
NODE arg; |
VECT *rp; |
VECT *rp; |
{ |
{ |
Obj mod; |
|
unsigned int *ka; |
unsigned int *ka; |
int len,i; |
int len,i; |
VECT *pa; |
VECT *pa; |
|
|
{ |
{ |
GF2N ax,bc,a0,a1,a2,b0,b1,b2; |
GF2N ax,bc,a0,a1,a2,b0,b1,b2; |
GF2N a2b0,a0b2,a2b1,a1b2,a02,a04,a22,a24,a0a2,a0a22,a1a2; |
GF2N a2b0,a0b2,a2b1,a1b2,a02,a04,a22,a24,a0a2,a0a22,a1a2; |
GF2N t,s,u,r0,r1,r00,r01,r02,r002,r003,r022,r02q; |
GF2N t,s,u,r0,r1,r00,r01,r02,r002,r003,r02q; |
VECT r; |
VECT r; |
GF2N *vb,*rb; |
GF2N *vb,*rb; |
|
|
Line 487 extern LM THREE_LM,FOUR_LM,EIGHT_LM; |
|
Line 486 extern LM THREE_LM,FOUR_LM,EIGHT_LM; |
|
unsigned int ecm_count_order_gfp(p,a,b) |
unsigned int ecm_count_order_gfp(p,a,b) |
unsigned int p,a,b; |
unsigned int p,a,b; |
{ |
{ |
unsigned int x,y,rhs,ord,t; |
unsigned int x,rhs,ord,t; |
|
|
for ( x = 0, ord = 1; x < p; x++ ) { |
for ( x = 0, ord = 1; x < p; x++ ) { |
DMAR(x,x,a,p,t) /* t = x^2+a mod p */ |
DMAR(x,x,a,p,t) /* t = x^2+a mod p */ |
|
|
GF2N a,b; |
GF2N a,b; |
{ |
{ |
error("ecm_count_order_gf2n : not implemented yet"); |
error("ecm_count_order_gf2n : not implemented yet"); |
|
/* NOTREACHED */ |
|
return 0; |
} |
} |
|
|
/* ec = [AX,BC] */ |
/* ec = [AX,BC] */ |
Line 647 void ecm_chsgn_ff(p,pr) |
|
Line 648 void ecm_chsgn_ff(p,pr) |
|
VECT p; |
VECT p; |
VECT *pr; |
VECT *pr; |
{ |
{ |
Obj m,x,y,z; |
Obj x,y,z; |
LM tl; |
LM tl; |
GF2N tg; |
GF2N tg; |
Obj *vb; |
Obj *vb; |
Line 732 unsigned int *ka; |
|
Line 733 unsigned int *ka; |
|
LM *b,*x,*z; |
LM *b,*x,*z; |
int i; |
int i; |
LM t,s,m; |
LM t,s,m; |
N lm; |
|
Q mod; |
|
|
|
b = (LM *)ALLOCA((len+1)*sizeof(LM)); |
b = (LM *)ALLOCA((len+1)*sizeof(LM)); |
x = (LM *)ALLOCA(len*sizeof(LM)); |
x = (LM *)ALLOCA(len*sizeof(LM)); |
Line 871 void sort_ktarray(karray,tarray,rp) |
|
Line 870 void sort_ktarray(karray,tarray,rp) |
|
VECT karray,tarray; |
VECT karray,tarray; |
LIST *rp; |
LIST *rp; |
{ |
{ |
LIST *lb; |
|
NODE r,r1; |
NODE r,r1; |
int i,i0,k,len,same,tsame; |
int i,i0,k,len,same,tsame; |
struct oKeyIndexPair *kip; |
struct oKeyIndexPair *kip; |