add poly.c for primitive polynomial gen