public static void Invert(ulong[] x, ulong[] z)
 {
     if (Nat448.IsZero64(x))
     {
         throw new InvalidOperationException();
     }
     ulong[] array  = Nat448.Create64();
     ulong[] array2 = Nat448.Create64();
     ulong[] array3 = Nat448.Create64();
     Square(x, array);
     SquareN(array, 1, array2);
     Multiply(array, array2, array);
     SquareN(array2, 1, array2);
     Multiply(array, array2, array);
     SquareN(array, 3, array2);
     Multiply(array, array2, array);
     SquareN(array, 6, array2);
     Multiply(array, array2, array);
     SquareN(array, 12, array2);
     Multiply(array, array2, array3);
     SquareN(array3, 24, array);
     SquareN(array, 24, array2);
     Multiply(array, array2, array);
     SquareN(array, 48, array2);
     Multiply(array, array2, array);
     SquareN(array, 96, array2);
     Multiply(array, array2, array);
     SquareN(array, 192, array2);
     Multiply(array, array2, array);
     Multiply(array, array3, z);
 }
示例#2
0
 public static void Invert(ulong[] x, ulong[] z)
 {
     //IL_0008: Unknown result type (might be due to invalid IL or missing references)
     if (Nat448.IsZero64(x))
     {
         throw new InvalidOperationException();
     }
     ulong[] array  = Nat448.Create64();
     ulong[] array2 = Nat448.Create64();
     ulong[] array3 = Nat448.Create64();
     Square(x, array);
     SquareN(array, 1, array2);
     Multiply(array, array2, array);
     SquareN(array2, 1, array2);
     Multiply(array, array2, array);
     SquareN(array, 3, array2);
     Multiply(array, array2, array);
     SquareN(array, 6, array2);
     Multiply(array, array2, array);
     SquareN(array, 12, array2);
     Multiply(array, array2, array3);
     SquareN(array3, 24, array);
     SquareN(array, 24, array2);
     Multiply(array, array2, array);
     SquareN(array, 48, array2);
     Multiply(array, array2, array);
     SquareN(array, 96, array2);
     Multiply(array, array2, array);
     SquareN(array, 192, array2);
     Multiply(array, array2, array);
     Multiply(array, array3, z);
 }
示例#3
0
 public static void Invert(ulong[] x, ulong[] z)
 {
     if (Nat448.IsZero64(x))
     {
         throw new InvalidOperationException();
     }
     ulong[] numArray  = Nat448.Create64();
     ulong[] numArray2 = Nat448.Create64();
     ulong[] numArray3 = Nat448.Create64();
     Square(x, numArray);
     SquareN(numArray, 1, numArray2);
     Multiply(numArray, numArray2, numArray);
     SquareN(numArray2, 1, numArray2);
     Multiply(numArray, numArray2, numArray);
     SquareN(numArray, 3, numArray2);
     Multiply(numArray, numArray2, numArray);
     SquareN(numArray, 6, numArray2);
     Multiply(numArray, numArray2, numArray);
     SquareN(numArray, 12, numArray2);
     Multiply(numArray, numArray2, numArray3);
     SquareN(numArray3, 0x18, numArray);
     SquareN(numArray, 0x18, numArray2);
     Multiply(numArray, numArray2, numArray);
     SquareN(numArray, 0x30, numArray2);
     Multiply(numArray, numArray2, numArray);
     SquareN(numArray, 0x60, numArray2);
     Multiply(numArray, numArray2, numArray);
     SquareN(numArray, 0xc0, numArray2);
     Multiply(numArray, numArray2, numArray);
     Multiply(numArray, numArray3, z);
 }
示例#4
0
        public static void Invert(ulong[] x, ulong[] z)
        {
            if (Nat448.IsZero64(x))
            {
                throw new InvalidOperationException();
            }

            // Itoh-Tsujii inversion with bases { 2, 3 }

            ulong[] t0 = Nat448.Create64();
            ulong[] t1 = Nat448.Create64();
            ulong[] t2 = Nat448.Create64();

            Square(x, t0);

            // 3 | 408
            SquareN(t0, 1, t1);
            Multiply(t0, t1, t0);
            SquareN(t1, 1, t1);
            Multiply(t0, t1, t0);

            // 2 | 136
            SquareN(t0, 3, t1);
            Multiply(t0, t1, t0);

            // 2 | 68
            SquareN(t0, 6, t1);
            Multiply(t0, t1, t0);

            // 2 | 34
            SquareN(t0, 12, t1);
            Multiply(t0, t1, t2);

            // ! {2,3} | 17
            SquareN(t2, 24, t0);
            SquareN(t0, 24, t1);
            Multiply(t0, t1, t0);

            // 2 | 8
            SquareN(t0, 48, t1);
            Multiply(t0, t1, t0);

            // 2 | 4
            SquareN(t0, 96, t1);
            Multiply(t0, t1, t0);

            // 2 | 2
            SquareN(t0, 192, t1);
            Multiply(t0, t1, t0);

            Multiply(t0, t2, z);
        }