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

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

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

            ulong[] tt = Nat.Create64(5);
            SecT131Field.MultiplyAddToExt(ax, bx, tt);
            SecT131Field.MultiplyAddToExt(xx, yx, tt);

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