SchnorrSign extends SchnorrVerify { public SchnorrSignature sign(byte[] message) throws NoSuchAlgorithmException { return sign(message, new BigInteger(Q.bitLength() - 1, random)); } SchnorrSign(byte[] privateKey); SchnorrSignature sign(byte[] message);  }
@Test public void main() throws Exception { for (SchnorrSignTestCase t : test) { SchnorrSign signer = new SchnorrSign(t.password.getBytes()); SchnorrSignature sign = signer.sign(t.message.getBytes(), t.random); BigInteger e = new BigInteger(Util.positiveIntToTwosCompliment(sign.getE())); BigInteger s = new BigInteger(Util.positiveIntToTwosCompliment(sign.getS())); assertTrue("Error when testing, t:\n"+t+"\nsign.e: "+e+"\nsign.s: "+s, t.e.equals(e) && t.s.equals(s)); } }