modular polynomial multiplication: testing

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

extern FIELD2N poly_prime;

int main(){
//   FIELD2N poly_prime = {0x5};
   FIELD2N a;
   FIELD2N b;
   FIELD2N c;

   null(&a);
   null(&b);
   null(&c);
   null(&poly_prime);

   a.e[NUMWORD] = 0x3;
   b.e[NUMWORD] = 0x7;
   poly_prime.e[NUMWORD] = 0x5;

   poly_mul(&a, &b, &c);

   print_field("a", &a);
   print_field("b", &b);
   print_field("c", &c);
   print_field("poly_prime", &poly_prime);

   return 0;
}

The result:

CGs-MacBook:Rosing polynomial chika$ ./poly_mul_CG
a
0 0 0 3
b
0 0 0 7
c
0 0 0 3
poly_prime
0 0 0 5

Advertisements