PointEd448 extends Point { @Override public Point scalarMultiply(BigInteger integer) { if (integer.equals(BigInteger.ZERO)) { return PointEd448.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]; } PointEd448(Coordinate x, Coordinate y, Coordinate z, Coordinate t); static PointEd448 fromAffine(Coordinate x, Coordinate y); @Override Point add(Point point); @Override Point doubling(); @Override Point scalarMultiply(BigInteger integer); @Override Point negateY(); @Override EncodedPoint encode(); @Override Point negate();  }
@Test public void success_ScalarMultipleBasePoint_2() { Point point = curve.getBasePoint().scalarMultiply(new BigInteger("2")); assertThat(point.getAffineX().getInteger(), is(new BigInteger("484559149530404593699549205258669689569094240458212040187660132787056912146709081364401144455726350866276831544947397859048262938744149"))); assertThat(point.getAffineY().getInteger(), is(new BigInteger("494088759867433727674302672526735089350544552303727723746126484473087719117037293890093462157703888342865036477787453078312060500281069"))); }
@Test public void success_ScalarMultipleBasePoint_3() { Point point = curve.getBasePoint().scalarMultiply(new BigInteger("3")); assertThat(point.getAffineX().getInteger(), is(new BigInteger("23839778817283171003887799738662344287085130522697782688245073320169861206004018274567429238677677920280078599146891901463786155880335"))); assertThat(point.getAffineY().getInteger(), is(new BigInteger("636046652612779686502873775776967954190574036985351036782021535703553242737829645273154208057988851307101009474686328623630835377952508"))); }
@Test public void success_ScalarMultipleBasePoint_7() { Point point = curve.getBasePoint().scalarMultiply(new BigInteger("7")); assertThat(point.getAffineX().getInteger(), is(new BigInteger("21552347002471831326081673315959198890815298992330888454662334499946296341989387947872761885158213982937463940347052051774843037018871"))); assertThat(point.getAffineY().getInteger(), is(new BigInteger("357373306191655299280537582309534138704679428048844536962096044990522311544407707633625075281628144531544209749465261583401063761590143"))); }
@Test public void success_ScalarMultipleBasePoint_8() { Point point = curve.getBasePoint().scalarMultiply(new BigInteger("8")); assertThat(point.getAffineX().getInteger(), is(new BigInteger("596076689965651660022516817574257859767655189303710608336194617254375604050911414190272256792693764900933801964043657940361520281271776"))); assertThat(point.getAffineY().getInteger(), is(new BigInteger("565960773781129488052659607211963370179410097582298438377162450965951398045899014271088170591759362241006993622586109875821902761156763"))); }
@Test public void success_ScalarMultipleBasePoint_9() { Point point = curve.getBasePoint().scalarMultiply(new BigInteger("9")); assertThat(point.getAffineX().getInteger(), is(new BigInteger("678819586033147925281023223806960408804378601126531157763570688900376738103095651143762799384400423222857151421219751020550555632887915"))); assertThat(point.getAffineY().getInteger(), is(new BigInteger("60696086077381741094032748984832537947444053808169978921575679174195124930944594569279421079811560196531757705827406107516052224374095"))); }
@Test public void success_ScalarMultipleBasePoint_10() { Point point = curve.getBasePoint().scalarMultiply(new BigInteger("10")); assertThat(point.getAffineX().getInteger(), is(new BigInteger("338669802554017338090741842335737823113336653904160109397584018105059385206196637853257117971041875208554805602850382915119972512247869"))); assertThat(point.getAffineY().getInteger(), is(new BigInteger("219150861381236143450521108354203769270679720218000652369136137699333671138749674479139795638088562049448210382871218396511167516106599"))); }
@Test public void success_ScalarMultipleBasePoint_47218412417289471() { Point point = curve.getBasePoint().scalarMultiply(new BigInteger("47218412417289471")); assertThat(point.getAffineX().getInteger(), is(new BigInteger("706962928758557286146477331671104898387376109527551747178149994986356021591923299562304281357717856573928016518683667087189558043425510"))); assertThat(point.getAffineY().getInteger(), is(new BigInteger("279992018783083106764723692021891527281730215435161171351137438665373473663265784536951370748332118946047677007832925697871713328581900"))); }