modifying curve setting up

/* CG - February 2010
   the program is supposed to find y for any given x
   [in progress]
   the representation is in polynomial
*/

#include <stdio.h>
#include <stdlib.h>
#include "field2n.h"
#include "poly.h"
#include "eliptic.h"

unsigned long random_seed;
extern FIELD2N poly_prime;

void set_field(value, n)
FIELD2N *value;
INDEX n;
{
   value->e[0] = n;
}

void set_curve(curv)
CURVE *curv;
{
   curv->form = 1;
   set_field(&curv->a6, 1L);   
   null(&curv->a2);
//   set_field(&curv->a2, 0L);
}	

int main()
{
   FIELD2N	*data, *data_juga;
   CURVE *curve;
   POINT *point;
   INDEX error;
   FIELD2N f;	
   POINT *pnt;

   curve = malloc(sizeof(CURVE));
   if (curve == NULL) {exit(-1);}

   point = malloc(sizeof(POINT));
   if (point == NULL) {exit(-1);}

   if (!irreducible(&poly_prime)) return(0);
      print_field("poly_prime = ", &poly_prime);
	
   if (error = init_poly_math())
      {
         printf("Can't initialize S matrix, row = %d\n", error);
	 return(-1);
      }

   printf("setting up curves \n\n");
  
   set_curve(curve); 
   print_curve("the curve after setting up: ", curve);
	
   return 0;
}


poly_prime =
8 0 0 0 0 c9
setting up curves

the curve after setting up:
form: 1
a2: 0 0 0 0 0 0
a6: 1 0 0 0 0 0

Advertisements