Beispiel #1
0
        private static EllipticCurvePoint getPoint(BigInteger u1, BigInteger u2, EllipticCurvePoint publicKey, EllipticCurve theCurve)
        {
            EllipticCurvePoint GDependentPoint         = PointMultiplication.multiplyPoint(u1, theCurve.G, theCurve);
            EllipticCurvePoint PublicKeyDependentPoint = PointMultiplication.multiplyPoint(u2, publicKey, theCurve);

            return(PointAddition.addPoints(theCurve, GDependentPoint, PublicKeyDependentPoint));
        }
Beispiel #2
0
    void Start()
    {
        coinManager   = GameObject.Find("CoinManager").GetComponent <CoinManager> ();
        pointAddition = gameObject.GetComponent <PointAddition> ();
        lastFeedTime  = DateTime.FromBinary(Convert.ToInt64(PlayerPrefs.GetString("LastFeedTime", DateTime.Now.AddDays(-1).ToBinary().ToString())));
        Debug.Log(lastFeedTime);

        if (lastFeedTime.Date < DateTime.Now.Date)
        {
            feedCooldown = false;
        }
        else if (feedCooldown)
        {
            if (DateTime.Now.Hour >= 6 && DateTime.Now.Hour < 9 && lastFeedTime.Hour >= 6 && lastFeedTime.Hour < 9)
            {
                feedCooldown = true;
            }
            else if (DateTime.Now.Hour >= 11 && DateTime.Now.Hour < 13 && lastFeedTime.Hour >= 11 && lastFeedTime.Hour < 13)
            {
                feedCooldown = true;
            }
            else if (DateTime.Now.Hour >= 17 && DateTime.Now.Hour < 20 && lastFeedTime.Hour >= 17 && lastFeedTime.Hour < 20)
            {
                feedCooldown = true;
            }
            else
            {
                feedCooldown = false;
            }
        }
    }
        private static EllipticCurvePoint getResult(int[] bits, int index, EllipticCurve curve, EllipticCurvePoint auxPoint)
        {
            EllipticCurvePoint result = auxPoint;

            while (index < bits.Length)
            {
                auxPoint = PointDoubling.doublePoint(curve, auxPoint);
                if (bits[index] == 1)
                {
                    result = PointAddition.addPoints(curve, result, auxPoint);
                }
                index++;
            }

            return(result);
        }
Beispiel #4
0
 void Start()
 {
     pointAddition = gameObject.GetComponent <PointAddition> ();
     lastPlayTime  = DateTime.FromBinary(Convert.ToInt64(PlayerPrefs.GetString("lastPlayTime", DateTime.Now.AddHours(-2).ToBinary().ToString())));
 }
Beispiel #5
0
 public static EllipticCurvePoint calculateMasterKey(BigInteger prk, EllipticCurvePoint theirPublicKey, EllipticCurve curve)
 {
     return(PointAddition.addPoints(curve, theirPublicKey, PointMultiplication.multiplyPoint(prk, curve.G, curve)));
 }
Beispiel #6
0
 void Start()
 {
     pointAddition = gameObject.GetComponent <PointAddition> ();
     lastPetTime   = DateTime.FromBinary(Convert.ToInt64(PlayerPrefs.GetString("lastPetTime", DateTime.Now.AddMinutes(-10).ToBinary().ToString())));
     petCount      = PlayerPrefs.GetInt("lastPetCount", 0);
 }