Ejemplo n.º 1
0
 public static void SquareN(ulong[] x, int n, ulong[] z)
 {
     ulong[] array = Nat192.CreateExt64();
     SecT163Field.ImplSquare(x, array);
     SecT163Field.Reduce(array, z);
     while (--n > 0)
     {
         SecT163Field.ImplSquare(z, array);
         SecT163Field.Reduce(array, z);
     }
 }
Ejemplo n.º 2
0
 public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y)
 {
     ulong[] array  = this.x;
     ulong[] array2 = ((SecT163FieldElement)x).x;
     ulong[] y2     = ((SecT163FieldElement)y).x;
     ulong[] array3 = Nat192.CreateExt64();
     SecT163Field.SquareAddToExt(array, array3);
     SecT163Field.MultiplyAddToExt(array2, y2, array3);
     ulong[] z = Nat192.Create64();
     SecT163Field.Reduce(array3, z);
     return(new SecT163FieldElement(z));
 }
Ejemplo n.º 3
0
        public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)
        {
            ulong[] ax = this.x, bx = ((SecT163FieldElement)b).x;
            ulong[] xx = ((SecT163FieldElement)x).x, yx = ((SecT163FieldElement)y).x;

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

            ulong[] z = Nat192.Create64();
            SecT163Field.Reduce(tt, z);
            return(new SecT163FieldElement(z));
        }
 public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)
 {
     ulong[] numArray  = this.x;
     ulong[] numArray2 = ((SecT163FieldElement)b).x;
     ulong[] numArray3 = ((SecT163FieldElement)x).x;
     ulong[] numArray4 = ((SecT163FieldElement)y).x;
     ulong[] zz        = Nat192.CreateExt64();
     SecT163Field.MultiplyAddToExt(numArray, numArray2, zz);
     SecT163Field.MultiplyAddToExt(numArray3, numArray4, zz);
     ulong[] z = Nat192.Create64();
     SecT163Field.Reduce(zz, z);
     return(new SecT163FieldElement(z));
 }
Ejemplo n.º 5
0
        public static void SquareN(ulong[] x, int n, ulong[] z)
        {
            Debug.Assert(n > 0);

            ulong[] tt = Nat192.CreateExt64();
            ImplSquare(x, tt);
            Reduce(tt, z);

            while (--n > 0)
            {
                ImplSquare(z, tt);
                Reduce(tt, z);
            }
        }
Ejemplo n.º 6
0
        public static void HalfTrace(ulong[] x, ulong[] z)
        {
            ulong[] tt = Nat192.CreateExt64();

            Nat192.Copy64(x, z);
            for (int i = 1; i < 163; i += 2)
            {
                ImplSquare(z, tt);
                Reduce(tt, z);
                ImplSquare(z, tt);
                Reduce(tt, z);
                AddTo(x, z);
            }
        }
Ejemplo n.º 7
0
 public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz)
 {
     ulong[] tt = Nat192.CreateExt64();
     ImplMultiply(x, y, tt);
     AddExt(zz, tt, zz);
 }
Ejemplo n.º 8
0
 public static void Multiply(ulong[] x, ulong[] y, ulong[] z)
 {
     ulong[] tt = Nat192.CreateExt64();
     ImplMultiply(x, y, tt);
     Reduce(tt, z);
 }
Ejemplo n.º 9
0
 public static void SquareAddToExt(ulong[] x, ulong[] zz)
 {
     ulong[] tt = Nat192.CreateExt64();
     ImplSquare(x, tt);
     AddExt(zz, tt, zz);
 }
Ejemplo n.º 10
0
 public static void Square(ulong[] x, ulong[] z)
 {
     ulong[] tt = Nat192.CreateExt64();
     ImplSquare(x, tt);
     Reduce(tt, z);
 }
Ejemplo n.º 11
0
 public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz)
 {
     ulong[] array = Nat192.CreateExt64();
     SecT131Field.ImplMultiply(x, y, array);
     SecT131Field.AddExt(zz, array, zz);
 }
Ejemplo n.º 12
0
 public static void Multiply(ulong[] x, ulong[] y, ulong[] z)
 {
     ulong[] array = Nat192.CreateExt64();
     SecT131Field.ImplMultiply(x, y, array);
     SecT131Field.Reduce(array, z);
 }
Ejemplo n.º 13
0
 public static void SquareAddToExt(ulong[] x, ulong[] zz)
 {
     ulong[] array = Nat192.CreateExt64();
     SecT163Field.ImplSquare(x, array);
     SecT163Field.AddExt(zz, array, zz);
 }
Ejemplo n.º 14
0
 public static void Square(ulong[] x, ulong[] z)
 {
     ulong[] array = Nat192.CreateExt64();
     SecT163Field.ImplSquare(x, array);
     SecT163Field.Reduce(array, z);
 }
Ejemplo n.º 15
0
 public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz)
 {
     ulong[] numArray = Nat192.CreateExt64();
     ImplMultiply(x, y, numArray);
     AddExt(zz, numArray, zz);
 }
Ejemplo n.º 16
0
 public static void Multiply(ulong[] x, ulong[] y, ulong[] z)
 {
     ulong[] zz = Nat192.CreateExt64();
     ImplMultiply(x, y, zz);
     Reduce(zz, z);
 }