Polynomial multiplication (without mod): a trial

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

extern FIELD2N poly_prime;

int main(){
//   FIELD2N a = {0x00000009};
   FIELD2N a, c1;
   DBLFIELD c2;

   null(&a);
   null(&c1);
   dblnull(&c2);

   a.e[NUMWORD] = 0x7;

   poly_mul_partial(&a, &a, &c2);

   dbltosngl(&c2, &c1);

   print_field("a", &a);
   print_field("c1", &c1);

   return 0;
}

The result:


lss-67-27:Rosing polynomial chika$ make polyCG
gcc -c polyCG.c
gcc -o polyCG polyCG.o poly_func.o eliptic_poly.o polymain.o
lss-67-27:Rosing polynomial chika$ ./polyCG
a
0 0 0 7
c1
0 0 0 15

Advertisements