CoordinateEd448 extends Coordinate { @Override public Coordinate negate() { return new CoordinateEd448(value.negate()).mod(); } CoordinateEd448(BigInteger integer); @Override Coordinate add(Coordinate val); @Override Coordinate divide(Coordinate val); @Override Coordinate multiply(Coordinate val); @Override Coordinate subtract(Coordinate val); @Override Coordinate mod(); @Override Coordinate inverse(); @Override Coordinate powerMod(BigInteger exponent); @Override Coordinate negate(); @Override EncodedCoordinate encode(); static final CoordinateEd448 ZERO; static final CoordinateEd448 ONE; }
@Test public void success_Negate_1() { Coordinate coordinate1 = new CoordinateEd448(new BigInteger("224580040295924300187604334099896036246789641632564134246125461686950415467406032909029192869357953282578032075146446173674602635247710")); Coordinate coordinate2 = new CoordinateEd448(new BigInteger("298819210078481492676017930443930673437544040154080242095928241372331506189835876003536878655418784733982303233503462500531545062832660")); Coordinate coordinate3 = new CoordinateEd448(new BigInteger("298003876961198825125222761234081859084992957881800404715410981664051054548359616801422517316457383831336442629355891318031934187529830")); Coordinate negatedCoordinate1 = coordinate1.negate(); Coordinate negatedCoordinate2 = coordinate2.negate(); Coordinate negatedCoordinate3 = coordinate3.negate(); assertThat(negatedCoordinate1.getInteger(), is(new BigInteger("502258683999682590361719473788108498106851719054753926035364737493661912699324739777367190829318592647510852386697191187378895383117729"))); assertThat(negatedCoordinate2.getInteger(), is(new BigInteger("428019514217125397873305877444073860916097320533237818185561957808280821976894896682859505043257761196106581228340174860521952955532779"))); assertThat(negatedCoordinate3.getInteger(), is(new BigInteger("428834847334408065424101046653922675268648402805517655566079217516561273618371155884973866382219162098752441832487746043021563830835609"))); }