예제 #1
0
        public static void Square(uint[] x, uint[] z)
        {
            var tt = Nat256.CreateExt();

            Nat256.Square(x, tt);
            Reduce(tt, z);
        }
예제 #2
0
 public static void SquareN(uint[] x, int n, uint[] z)
 {
     uint[] array = Nat256.CreateExt();
     Nat256.Square(x, array);
     Reduce(array, z);
     while (--n > 0)
     {
         Nat256.Square(z, array);
         Reduce(array, z);
     }
 }
예제 #3
0
 public static void SquareN(uint[] x, int n, uint[] z)
 {
     uint[] zz = Nat256.CreateExt();
     Nat256.Square(x, zz);
     Reduce(zz, z);
     while (--n > 0)
     {
         Nat256.Square(z, zz);
         Reduce(zz, z);
     }
 }
예제 #4
0
        public static void SquareN(uint[] x, int n, uint[] z)
        {
            Debug.Assert(n > 0);

            uint[] tt = Nat256.CreateExt();
            Nat256.Square(x, tt);
            Reduce(tt, z);

            while (--n > 0)
            {
                Nat256.Square(z, tt);
                Reduce(tt, z);
            }
        }
예제 #5
0
        public static void Square(uint[] x, uint[] zz)
        {
            Nat256.Square(x, zz);
            Nat256.Square(x, 8, zz, 16);
            uint num = Nat256.AddToEachOther(zz, 8, zz, 16);
            uint cIn = num + Nat256.AddTo(zz, 0, zz, 8, 0u);

            num += Nat256.AddTo(zz, 24, zz, 16, cIn);
            uint[] array = Nat256.Create();
            Nat256.Diff(x, 8, x, 0, array, 0);
            uint[] array2 = Nat256.CreateExt();
            Nat256.Square(array, array2);
            num = (uint)((int)num + Nat.SubFrom(16, array2, 0, zz, 8));
            Nat.AddWordAt(32, num, zz, 24);
        }
예제 #6
0
        public static void Square(uint[] x, uint[] zz)
        {
            Nat256.Square(x, zz);
            Nat256.Square(x, 8, zz, 16);

            uint c24 = Nat256.AddToEachOther(zz, 8, zz, 16);
            uint c16 = c24 + Nat256.AddTo(zz, 0, zz, 8, 0);

            c24 += Nat256.AddTo(zz, 24, zz, 16, c16);

            uint[] dx = Nat256.Create();
            Nat256.Diff(x, 8, x, 0, dx, 0);

            uint[] m = Nat256.CreateExt();
            Nat256.Square(dx, m);

            c24 += (uint)Nat.SubFrom(16, m, 0, zz, 8);
            Nat.AddWordAt(32, c24, zz, 24);
        }
예제 #7
0
 public static void Square(uint[] x, uint[] z)
 {
     uint[] array = Nat256.CreateExt();
     Nat256.Square(x, array);
     Reduce(array, z);
 }
예제 #8
0
 public static void Square(uint[] x, uint[] z)
 {
     uint[] zz = Nat256.CreateExt();
     Nat256.Square(x, zz);
     Reduce(zz, z);
 }