// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIGN_MESSAGE = "916c7d1d268fc0e77c1bef238432573c39be577bbea0998936add2b50a653171" +
//         "ce18a542b0b7f96c1691a3be6031522894a8634183eda38798a0c5d5d79fbd01" +
//         "dd04a8646d71873b77b221998a81922d8105f892316369d5224c9983372d2313" +
//         "c6b1f4556ea26ba49d46e8b561e0fc76633ac9766e68e21fba7edca93c4c7460" +
//         "376d7f3ac22ff372c18f613f2ae2e856af40";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIGN_PRIVATE = "b18e1d0045995ec3d010c387ccfeb984d783af8fbb0f40fa7db126d889f6dadd";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIGN_PUBLIC = "77f48b59caeda77751ed138b0ec667ff50f8768c25d48309a8f386a2bad187fb";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIGN_SIGNATURE = "6bd710a368c1249923fc7a1610747403040f0cc30815a00f9ff548a896bbda0b" +
//         "4eb2ca19ebcf917f0f34200a9edbad3901b64ab09cc5ef7b9bcc3c40c0ff7509";


import org.junit.Test;
import java.util.Arrays;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.abstractj.kalium.encoders.Encoder.HEX;
import static org.abstractj.kalium.fixture.TestVectors.SIGN_MESSAGE;
import static org.abstractj.kalium.fixture.TestVectors.SIGN_PRIVATE;
import static org.abstractj.kalium.fixture.TestVectors.SIGN_PUBLIC;
import static org.abstractj.kalium.fixture.TestVectors.SIGN_SIGNATURE;
import static org.junit.Assert.fail;
    @Test
    public void testVerifyCorrectHexSignature() throws Exception {
        byte[] rawPublicKey = HEX.decode(SIGN_PUBLIC);
        VerifyKey verifyKey = new VerifyKey(rawPublicKey);
        verifyKey.verify(SIGN_MESSAGE, SIGN_SIGNATURE, HEX);
        assertTrue(verifyKey.verify(SIGN_MESSAGE, SIGN_SIGNATURE, HEX));
    }

    @Test
    public void testDetectBadSignature() throws Exception {
        try {
            String badSignature = SIGN_SIGNATURE.concat("0000");
            VerifyKey verifyKey = new VerifyKey(SIGN_PUBLIC, HEX);
            verifyKey.verify(SIGN_MESSAGE, badSignature, HEX);
            fail("Should an exception on bad signatures");
        } catch (Exception e) {
            assertTrue(true);
        }
    }

    @Test
    public void testSerializeToBytes() throws Exception {
        byte[] rawPublic = HEX.decode(SIGN_PUBLIC);
        VerifyKey verifyKey = new VerifyKey(SIGN_PUBLIC, HEX);
        verifyKey.verify(SIGN_MESSAGE, SIGN_SIGNATURE, HEX);
        assertTrue(Arrays.equals(verifyKey.toBytes(), rawPublic));
    }

    @Test
    public void testSerializeToString() throws Exception {
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIGN_MESSAGE = "916c7d1d268fc0e77c1bef238432573c39be577bbea0998936add2b50a653171" +
//         "ce18a542b0b7f96c1691a3be6031522894a8634183eda38798a0c5d5d79fbd01" +
//         "dd04a8646d71873b77b221998a81922d8105f892316369d5224c9983372d2313" +
//         "c6b1f4556ea26ba49d46e8b561e0fc76633ac9766e68e21fba7edca93c4c7460" +
//         "376d7f3ac22ff372c18f613f2ae2e856af40";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIGN_PRIVATE = "b18e1d0045995ec3d010c387ccfeb984d783af8fbb0f40fa7db126d889f6dadd";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIGN_PUBLIC = "77f48b59caeda77751ed138b0ec667ff50f8768c25d48309a8f386a2bad187fb";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIGN_SIGNATURE = "6bd710a368c1249923fc7a1610747403040f0cc30815a00f9ff548a896bbda0b" +
//         "4eb2ca19ebcf917f0f34200a9edbad3901b64ab09cc5ef7b9bcc3c40c0ff7509";


// Path: src/test/java/org/abstractj/kalium/keys/VerifyKeyTest.java
import org.junit.Test;
import java.util.Arrays;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.abstractj.kalium.encoders.Encoder.HEX;
import static org.abstractj.kalium.fixture.TestVectors.SIGN_MESSAGE;
import static org.abstractj.kalium.fixture.TestVectors.SIGN_PRIVATE;
import static org.abstractj.kalium.fixture.TestVectors.SIGN_PUBLIC;
import static org.abstractj.kalium.fixture.TestVectors.SIGN_SIGNATURE;
import static org.junit.Assert.fail;

    @Test
    public void testVerifyCorrectHexSignature() throws Exception {
        byte[] rawPublicKey = HEX.decode(SIGN_PUBLIC);
        VerifyKey verifyKey = new VerifyKey(rawPublicKey);
        verifyKey.verify(SIGN_MESSAGE, SIGN_SIGNATURE, HEX);
        assertTrue(verifyKey.verify(SIGN_MESSAGE, SIGN_SIGNATURE, HEX));
    }

    @Test
    public void testDetectBadSignature() throws Exception {
        try {
            String badSignature = SIGN_SIGNATURE.concat("0000");
            VerifyKey verifyKey = new VerifyKey(SIGN_PUBLIC, HEX);
            verifyKey.verify(SIGN_MESSAGE, badSignature, HEX);
            fail("Should an exception on bad signatures");
        } catch (Exception e) {
            assertTrue(true);
        }
    }

    @Test
    public void testSerializeToBytes() throws Exception {
        byte[] rawPublic = HEX.decode(SIGN_PUBLIC);
        VerifyKey verifyKey = new VerifyKey(SIGN_PUBLIC, HEX);
        verifyKey.verify(SIGN_MESSAGE, SIGN_SIGNATURE, HEX);
        assertTrue(Arrays.equals(verifyKey.toBytes(), rawPublic));
    }

    @Test
    public void testSerializeToString() throws Exception {
        SigningKey key = new SigningKey(SIGN_PRIVATE, HEX);