コード例 #1
0
        public static void AddOne(uint[] x, uint[] z)
        {
            Nat256.Copy(x, z);
            uint c = Nat256.Inc(z, 0);

            if (c != 0 || (z[7] == P7 && Nat256.Gte(z, P)))
            {
                Nat256.Sub(z, P, z);
            }
        }
コード例 #2
0
 public static void AddOne(uint[] x, uint[] z)
 {
     Nat256.Copy(x, z);
     Nat256.Inc(z, 0);
     if (Nat256.Gte(z, P))
     {
         Nat256.AddWord(PInv, z, 0);
         z[7] &= P7;
     }
 }
コード例 #3
0
        public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len)
        {
            uint[] table = new uint[len * SECP256K1_FE_INTS * 2];
            {
                int pos = 0;
                for (int i = 0; i < len; ++i)
                {
                    ECPoint p = points[off + i];
                    Nat256.Copy(((SecP256K1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP256K1_FE_INTS;
                    Nat256.Copy(((SecP256K1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP256K1_FE_INTS;
                }
            }

            return(new SecP256K1LookupTable(this, table, len));
        }