package org.bouncycastle.math.ec; import java.math.BigInteger; /* loaded from: classes6.dex */ public class NafR2LMultiplier extends AbstractECMultiplier { @Override // org.bouncycastle.math.ec.AbstractECMultiplier protected ECPoint multiplyPositive(ECPoint eCPoint, BigInteger bigInteger) { int[] generateCompactNaf = WNafUtil.generateCompactNaf(bigInteger); ECPoint infinity = eCPoint.getCurve().getInfinity(); int i = 0; int i2 = 0; while (i < generateCompactNaf.length) { int i3 = generateCompactNaf[i]; eCPoint = eCPoint.timesPow2(i2 + (65535 & i3)); infinity = infinity.add((i3 >> 16) < 0 ? eCPoint.negate() : eCPoint); i++; i2 = 1; } return infinity; } }