/** * Multiplies a {@link noconflict.org.bouncycastle.math.ec.ECPoint.F2m ECPoint.F2m} by <code>k * </code> using the reduced <code>τ</code>-adic NAF (RTNAF) method. * * @param p The ECPoint.F2m to multiply. * @param k The integer by which to multiply <code>k</code>. * @return <code>p</code> multiplied by <code>k</code>. */ public ECPoint multiply(ECPoint point, BigInteger k, PreCompInfo preCompInfo) { if (!(point instanceof ECPoint.F2m)) { throw new IllegalArgumentException("Only ECPoint.F2m can be " + "used in WTauNafMultiplier"); } ECPoint.F2m p = (ECPoint.F2m) point; ECCurve.F2m curve = (ECCurve.F2m) p.getCurve(); int m = curve.getM(); byte a = curve.getA().toBigInteger().byteValue(); byte mu = curve.getMu(); BigInteger[] s = curve.getSi(); ZTauElement rho = Tnaf.partModReduction(k, m, a, s, mu, (byte) 10); return multiplyWTnaf(p, rho, preCompInfo, a, mu); }