Exemple #1
0
        public override ECFieldElement Square()
        {
            IntArray squared = x.Square(m);

            squared.Reduce(m, new int[] { k1, k2, k3 });
            return(new F2mFieldElement(m, k1, k2, k3, squared));
        }
Exemple #2
0
        public override ECFieldElement Multiply(
            ECFieldElement b)
        {
            // Right-to-left comb multiplication in the IntArray
            // Input: Binary polynomials a(z) and b(z) of degree at most m-1
            // Output: c(z) = a(z) * b(z) mod f(z)

            // No check performed here for performance reasons. Instead the
            // elements involved are checked in ECPoint.F2m
            // checkFieldElements(this, b);
            F2mFieldElement bF2m = (F2mFieldElement)b;
            IntArray        mult = x.Multiply(bF2m.x, m);

            mult.Reduce(m, new int[] { k1, k2, k3 });
            return(new F2mFieldElement(m, k1, k2, k3, mult));
        }