Ejemplo n.º 1
0
        public SecT571FieldElement(BigInteger x)
        {
            if (x == null || x.SignValue < 0 || x.BitLength > 571)
            {
                throw new ArgumentException("value invalid for SecT571FieldElement", "x");
            }

            this.x = SecT571Field.FromBigInteger(x);
        }
Ejemplo n.º 2
0
        public override ECFieldElement SquarePow(int pow)
        {
            if (pow < 1)
            {
                return(this);
            }

            ulong[] z = Nat576.Create64();
            SecT571Field.SquareN(x, pow, z);
            return(new SecT571FieldElement(z));
        }
Ejemplo n.º 3
0
        public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)
        {
            ulong[] ax = this.x, bx = ((SecT571FieldElement)b).x;
            ulong[] xx = ((SecT571FieldElement)x).x, yx = ((SecT571FieldElement)y).x;

            ulong[] tt = Nat576.CreateExt64();
            SecT571Field.MultiplyAddToExt(ax, bx, tt);
            SecT571Field.MultiplyAddToExt(xx, yx, tt);

            ulong[] z = Nat576.Create64();
            SecT571Field.Reduce(tt, z);
            return(new SecT571FieldElement(z));
        }
Ejemplo n.º 4
0
 public override ECFieldElement Multiply(ECFieldElement b)
 {
     ulong[] z = Nat576.Create64();
     SecT571Field.Multiply(x, ((SecT571FieldElement)b).x, z);
     return(new SecT571FieldElement(z));
 }
Ejemplo n.º 5
0
 public override ECFieldElement AddOne()
 {
     ulong[] z = Nat576.Create64();
     SecT571Field.AddOne(x, z);
     return(new SecT571FieldElement(z));
 }