|
|
@ -52,4 +52,20 @@ public class WeierstrassPoint { |
|
|
|
y = x.add(this.x.negate()).multiply(m).add(this.y); |
|
|
|
return new WeierstrassPoint(this.curve, x, y); |
|
|
|
} |
|
|
|
|
|
|
|
public WeierstrassPoint mult(BigInteger n) |
|
|
|
{ |
|
|
|
if (n.compareTo(BigInteger.ZERO) == 0) |
|
|
|
{ |
|
|
|
return new WeierstrassPoint(this.curve); |
|
|
|
} |
|
|
|
WeierstrassPoint half = this.mult(n.shiftRight(1)); |
|
|
|
if (n.getLowestSetBit() == 0) |
|
|
|
{ |
|
|
|
return this.add(half).add(half); |
|
|
|
} else |
|
|
|
{ |
|
|
|
return half.add(half); |
|
|
|
} |
|
|
|
} |
|
|
|
} |