public static int Evaluate(List<int> poly, int x)
 {
     int y = poly[0];
     GaloisField gf = new GaloisField();
     for (int i = 1; i < poly.Count; i++)
     {
         y = gf.Multiply(y, x) ^ poly[i];
     }
     return y;
 }
 public static List<int> Scale(List<int> poly, int x)
 {
     int count = poly.Count;
     GaloisField gf = new GaloisField();
     int[] r = new int[poly.Count];
     //List<int> r = new List<int>(poly.Count);
     for (int i = 0; i < count; i++)
     {
         r[i] = gf.Multiply(poly[i], x);
     }
     return new List<int>(r);
 }
        public static List<int> Multiply(List<int> poly1, List<int> poly2)
        {
            GaloisField gf = new GaloisField();
            int count1 = poly1.Count;
            int count2 = poly2.Count;
            int[] r = new int[count1 + count2 - 1];

            for (int j = 0; j < count2; j++)
            {
                for (int i = 0; i < count1; i++)
                {
                    r[i + j] ^= gf.Multiply(poly1[i], poly2[j]);
                }
            }
            return new List<int>(r);
        }