Exemplo n.º 1
0
        public static void Add(uint[] x, uint[] y, uint[] z)
        {
            uint c = Nat256.Add(x, y, z);

            if (c != 0 || (z[7] >= P7 && Nat256.Gte(z, P)))
            {
                AddPInvTo(z);
            }
        }
Exemplo n.º 2
0
        public static void Add(uint[] x, uint[] y, uint[] z)
        {
            uint c = Nat256.Add(x, y, z);

            if (c != 0 || (z[7] == P7 && Nat256.Gte(z, P)))
            {
                Nat.Add33To(8, PInv33, z);
            }
        }
Exemplo n.º 3
0
        public static void AddExt(uint[] xx, uint[] yy, uint[] zz)
        {
            uint c = Nat256.Add(xx, yy, zz);

            if (c != 0 || (zz[7] >= PExt7 && Nat256.Gte(zz, PExt)))
            {
                Nat.AddTo(PExtInv.Length, PExtInv, zz);
            }
        }
Exemplo n.º 4
0
 public static void Half(uint[] x, uint[] z)
 {
     if ((x[0] & 1) == 0)
     {
         Nat.ShiftDownBit(8, x, 0u, z);
         return;
     }
     Nat256.Add(x, P, z);
     Nat.ShiftDownBit(8, z, 0u);
 }
Exemplo n.º 5
0
 public static void Half(uint[] x, uint[] z)
 {
     if ((x[0] & 1u) == 0u)
     {
         Nat.ShiftDownBit(8, x, 0u, z);
         return;
     }
     Nat256.Add(x, Curve25519Field.P, z);
     Nat.ShiftDownBit(8, z, 0u);
 }
Exemplo n.º 6
0
 public static void Half(uint[] x, uint[] z)
 {
     if ((x[0] & 1) == 0)
     {
         Nat.ShiftDownBit(8, x, 0, z);
     }
     else
     {
         Nat256.Add(x, P, z);
         Nat.ShiftDownBit(8, z, 0);
     }
 }