test_class.file: java_src/src/test/java/com/google/crypto/tink/subtle/Ed25519VerifyTest.java
test_class.identifier: Ed25519VerifyTest
test_case.body: @Test
    public void testVerificationWithWycheproofVectors() 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[] publicKey = Hex.decode(key.getString("pk"));
        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");
          Ed25519Verify verifier = new Ed25519Verify(publicKey);
          try {
            verifier.verify(sig, msg);
            if (result.equals("invalid")) {
              System.out.printf("FAIL %s: accepting invalid signature%n", tcId);
              errors++;
            }
          } catch (GeneralSecurityException ex) {
            if (result.equals("valid")) {
              System.out.printf("FAIL %s: rejecting valid signature, exception: %s%n", tcId, ex);
              errors++;
            }
          }
        }
      }
      assertEquals(0, errors);
    }
test_case.class_method_signature: Ed25519VerifyTest.testVerificationWithWycheproofVectors()
test_case.full_signature: @Test public void testVerificationWithWycheproofVectors()
test_case.identifier: testVerificationWithWycheproofVectors
test_case.invocations: readJson getJSONArray length getJSONObject getJSONObject decode getString getJSONArray length getJSONObject format getInt getString getMessage decode getString getString verify equals printf equals printf assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testVerificationWithWycheproofVectors()
focal_class.declarator: PUBLIC_KEY_LEN = Field25519.FIELD_LEN
focal_class.modifier: public static final
focal_class.original_string: public static final int PUBLIC_KEY_LEN = Field25519.FIELD_LEN;
focal_class.type: int
focal_class.var_name: PUBLIC_KEY_LEN
focal_class.declarator: SIGNATURE_LEN = Field25519.FIELD_LEN * 2
focal_class.modifier: public static final
focal_class.original_string: public static final int SIGNATURE_LEN = Field25519.FIELD_LEN * 2;
focal_class.type: int
focal_class.var_name: SIGNATURE_LEN
focal_class.declarator: publicKey
focal_class.modifier: private final
focal_class.original_string: private final ImmutableByteArray publicKey;
focal_class.type: ImmutableByteArray
focal_class.var_name: publicKey
focal_class.file: java_src/src/main/java/com/google/crypto/tink/subtle/Ed25519Verify.java
focal_class.identifier: Ed25519Verify
focal_class.interfaces: implements PublicKeyVerify
focal_class.class_method_signature: Ed25519Verify.Ed25519Verify(final byte[] publicKey)
focal_class.full_signature: public  Ed25519Verify(final byte[] publicKey)
focal_class.identifier: Ed25519Verify
focal_class.modifiers: public
focal_class.parameters: (final byte[] publicKey)
focal_class.signature:  Ed25519Verify(final byte[] publicKey)
focal_class.class_method_signature: Ed25519Verify.verify(byte[] signature, byte[] data)
focal_class.full_signature: @Override public void verify(byte[] signature, byte[] data)
focal_class.identifier: verify
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] signature, byte[] data)
focal_class.return: void
focal_class.signature: void verify(byte[] signature, byte[] data)
focal_method.body: @Override
    public void verify(byte[] signature, byte[] data) throws GeneralSecurityException {
      if (signature.length != SIGNATURE_LEN) {
        throw new GeneralSecurityException(
            String.format("The length of the signature is not %s.", SIGNATURE_LEN));
      }
      if (!Ed25519.verify(data, signature, publicKey.getBytes())) {
        throw new GeneralSecurityException("Signature check failed.");
      }
    }
focal_method.class_method_signature: Ed25519Verify.verify(byte[] signature, byte[] data)
focal_method.full_signature: @Override public void verify(byte[] signature, byte[] data)
focal_method.identifier: verify
focal_method.invocations: format verify getBytes
focal_method.modifiers: @Override public
focal_method.parameters: (byte[] signature, byte[] data)
focal_method.return: void
focal_method.signature: void verify(byte[] signature, byte[] data)