Ecc25519Helper { public byte[] sign(byte[] message) { return signWithoutClamp(message, mKeyHolder.getPrivateKey(), mKeyHolder.getPublicKeySignature()); } Ecc25519Helper();  Ecc25519Helper(byte[] privateKey);  Ecc25519Helper(KeyHolder keyHolder); byte[] diffieHellman(); byte[] diffieHellman(byte[] privateKey, byte[] publicKey); byte[] sign(byte[] message); byte[] sign(byte[] message, byte[] privateKey, byte[] publicKey); boolean isValidSignature(byte[] message, byte[] signature); boolean isValidSignature(byte[] message, byte[] signature, byte[] publicKey); KeyHolder getKeyHolder();  }
@Test public void ecc25519HelperSignIsSideEffectFreeOnPrivateKeyParameter() { final byte[] pk1 = KeyHolder.createPrivateKey("hello".getBytes()); final byte[] pk2 = pk1.clone(); byte[] sig = new Ecc25519Helper().sign("message".getBytes(), pk2, new KeyHolder(pk1.clone()).getPublicKeySignature()); assertArrayEquals(pk1, pk2); }