Пример #1
0
        protected override ECPoint MultiplyPositive(ECPoint point, BigInteger k)
        {
            if (!(point is AbstractF2mPoint))
            {
                throw new ArgumentException("Only AbstractF2mPoint can be used in WTauNafMultiplier");
            }
            AbstractF2mPoint p     = (AbstractF2mPoint)point;
            AbstractF2mCurve curve = (AbstractF2mCurve)p.Curve;
            int   fieldSize        = curve.FieldSize;
            sbyte intValue         = (sbyte)curve.A.ToBigInteger().IntValue;
            sbyte mu = Tnaf.GetMu((int)intValue);

            BigInteger[] si     = curve.GetSi();
            ZTauElement  lambda = Tnaf.PartModReduction(k, fieldSize, intValue, si, mu, 10);

            return(this.MultiplyWTnaf(p, lambda, curve.GetPreCompInfo(p, PRECOMP_NAME), intValue, mu));
        }
Пример #2
0
        protected override ECPoint MultiplyPositive(ECPoint point, BigInteger k)
        {
            //IL_000d: Unknown result type (might be due to invalid IL or missing references)
            if (!(point is AbstractF2mPoint))
            {
                throw new ArgumentException("Only AbstractF2mPoint can be used in WTauNafMultiplier");
            }
            AbstractF2mPoint abstractF2mPoint = (AbstractF2mPoint)point;
            AbstractF2mCurve abstractF2mCurve = (AbstractF2mCurve)abstractF2mPoint.Curve;
            int   fieldSize = abstractF2mCurve.FieldSize;
            sbyte b         = (sbyte)abstractF2mCurve.A.ToBigInteger().IntValue;
            sbyte mu        = Tnaf.GetMu(b);

            BigInteger[] si     = abstractF2mCurve.GetSi();
            ZTauElement  lambda = Tnaf.PartModReduction(k, fieldSize, b, si, mu, 10);

            return(MultiplyWTnaf(abstractF2mPoint, lambda, abstractF2mCurve.GetPreCompInfo(abstractF2mPoint, PRECOMP_NAME), b, mu));
        }
Пример #3
0
        /**
         * Multiplies a {@link NBitcoin.BouncyCastle.math.ec.AbstractF2mPoint AbstractF2mPoint}
         * by <code>k</code> using the reduced <code>&#964;</code>-adic NAF (RTNAF)
         * method.
         * @param p The AbstractF2mPoint to multiply.
         * @param k The integer by which to multiply <code>k</code>.
         * @return <code>p</code> multiplied by <code>k</code>.
         */
        protected override ECPoint MultiplyPositive(ECPoint point, BigInteger k)
        {
            if (!(point is AbstractF2mPoint))
            {
                throw new ArgumentException("Only AbstractF2mPoint can be used in WTauNafMultiplier");
            }

            AbstractF2mPoint p     = (AbstractF2mPoint)point;
            AbstractF2mCurve curve = (AbstractF2mCurve)p.Curve;
            int   m  = curve.FieldSize;
            sbyte a  = (sbyte)curve.A.ToBigInteger().IntValue;
            sbyte mu = Tnaf.GetMu(a);

            BigInteger[] s = curve.GetSi();

            ZTauElement rho = Tnaf.PartModReduction(k, m, a, s, mu, (sbyte)10);

            return(MultiplyWTnaf(p, rho, curve.GetPreCompInfo(p, PRECOMP_NAME), a, mu));
        }