@Test public void success_ScalarMultiplyBasePoint_11() { Point doubled = curve.getBasePoint().scalarMultiply(new BigInteger("11")); assertThat(doubled.getAffineX().getInteger(), is(new BigInteger("9451145793506787353375160377761530931587019091193333050860601958827395183563"))); assertThat(doubled.getAffineY().getInteger(), is(new BigInteger("20609402718286069808115703540855311742885093522056241285814584245966805874451"))); }
@Override public final Point scalarMultiply(BigInteger integer) { if (integer.equals(BigInteger.ZERO)) { return PointEd25519.O; } Point[] qs = new Point[]{O, O}; Point[] rs = new Point[]{this, this, negateY()}; int[] signedBin = ArrayUtils.toMutualOppositeForm(integer); for (int aSignedBin : signedBin) { qs[0] = qs[0].doubling(); qs[1] = qs[0].add(rs[1 - aSignedBin]).negate(); qs[0] = qs[(aSignedBin ^ (aSignedBin >> 31)) - (aSignedBin >> 31)]; } return qs[0]; }
PointEd25519 extends Point { @Override public final Point scalarMultiply(BigInteger integer) { if (integer.equals(BigInteger.ZERO)) { return PointEd25519.O; } Point[] qs = new Point[]{O, O}; Point[] rs = new Point[]{this, this, negateY()}; int[] signedBin = ArrayUtils.toMutualOppositeForm(integer); for (int aSignedBin : signedBin) { qs[0] = qs[0].doubling(); qs[1] = qs[0].add(rs[1 - aSignedBin]).negate(); qs[0] = qs[(aSignedBin ^ (aSignedBin >> 31)) - (aSignedBin >> 31)]; } return qs[0]; } }
PointEd25519 extends Point { @Override public final Point scalarMultiply(BigInteger integer) { if (integer.equals(BigInteger.ZERO)) { return PointEd25519.O; } Point[] qs = new Point[]{O, O}; Point[] rs = new Point[]{this, this, negateY()}; int[] signedBin = ArrayUtils.toMutualOppositeForm(integer); for (int aSignedBin : signedBin) { qs[0] = qs[0].doubling(); qs[1] = qs[0].add(rs[1 - aSignedBin]).negate(); qs[0] = qs[(aSignedBin ^ (aSignedBin >> 31)) - (aSignedBin >> 31)]; } return qs[0]; } PointEd25519(Coordinate x, Coordinate y, Coordinate z, Coordinate t); }
PointEd25519 extends Point { @Override public final Point scalarMultiply(BigInteger integer) { if (integer.equals(BigInteger.ZERO)) { return PointEd25519.O; } Point[] qs = new Point[]{O, O}; Point[] rs = new Point[]{this, this, negateY()}; int[] signedBin = ArrayUtils.toMutualOppositeForm(integer); for (int aSignedBin : signedBin) { qs[0] = qs[0].doubling(); qs[1] = qs[0].add(rs[1 - aSignedBin]).negate(); qs[0] = qs[(aSignedBin ^ (aSignedBin >> 31)) - (aSignedBin >> 31)]; } return qs[0]; } PointEd25519(Coordinate x, Coordinate y, Coordinate z, Coordinate t); static PointEd25519 fromAffine(Coordinate x, Coordinate y); @Override final Point add(Point point); @Override Point doubling(); @Override final Point scalarMultiply(BigInteger integer); @Override Point negateY(); @Override final EncodedPoint encode(); @Override Point negate(); }
PointEd25519 extends Point { @Override public final Point scalarMultiply(BigInteger integer) { if (integer.equals(BigInteger.ZERO)) { return PointEd25519.O; } Point[] qs = new Point[]{O, O}; Point[] rs = new Point[]{this, this, negateY()}; int[] signedBin = ArrayUtils.toMutualOppositeForm(integer); for (int aSignedBin : signedBin) { qs[0] = qs[0].doubling(); qs[1] = qs[0].add(rs[1 - aSignedBin]).negate(); qs[0] = qs[(aSignedBin ^ (aSignedBin >> 31)) - (aSignedBin >> 31)]; } return qs[0]; } PointEd25519(Coordinate x, Coordinate y, Coordinate z, Coordinate t); static PointEd25519 fromAffine(Coordinate x, Coordinate y); @Override final Point add(Point point); @Override Point doubling(); @Override final Point scalarMultiply(BigInteger integer); @Override Point negateY(); @Override final EncodedPoint encode(); @Override Point negate();  }