@Test
public void testSigningWithWycheproofVectors() throws Exception {

  JSONObject json =
      WycheproofTestUtil.readJson("../wycheproof/testvectors/eddsa_test.json");
  int errors = 0;
  JSONArray testGroups = json.getJSONArray("testGroups");
  for (int i = 0; i < testGroups.length(); i++) {
    JSONObject group = testGroups.getJSONObject(i);
    JSONObject key = group.getJSONObject("key");
    byte[] privateKey = Hex.decode(key.getString("sk"));
    JSONArray tests = group.getJSONArray("tests");
    for (int j = 0; j < tests.length(); j++) {
      JSONObject testcase = tests.getJSONObject(j);
      String tcId =
          String.format(
              "testcase %d (%s)", testcase.getInt("tcId"), testcase.getString("comment"));
      byte[] msg = getMessage(testcase);
      byte[] sig = Hex.decode(testcase.getString("sig"));
      String result = testcase.getString("result");
      if (result.equals("invalid")) {
        continue;
      }
      Ed25519Sign signer = new Ed25519Sign(privateKey);
      byte[] computedSig = signer.sign(msg);
      assertArrayEquals(tcId, sig, computedSig);
    }
  }
  assertEquals(0, errors);
}