// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String AUTH_HMAC_SHA512256 = "b2a31b8d4e01afcab2ee545b5caf4e3d212a99d7b3a116a97cec8e83c32e107d";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String AUTH_KEY = "eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String AUTH_MESSAGE = "8e993b9f48681273c29650ba32fc76ce48332ea7164d96a4476fb8c531a1186a" +
//         "c0dfc17c98dce87b4da7f011ec48c97271d2c20f9b928fe2270d6fb863d51738" +
//         "b48eeee314a7cc8ab932164548e526ae90224368517acfeabd6bb3732bc0e9da" +
//         "99832b61ca01b6de56244a9e88d5f9b37973f622a43d14a6599b1f654cb45a74" +
//         "e355a5";


import org.junit.Test;
import java.util.Arrays;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import static org.abstractj.kalium.NaCl.Sodium.CRYPTO_AUTH_HMACSHA512256_KEYBYTES;
import static org.abstractj.kalium.encoders.Encoder.HEX;
import static org.abstractj.kalium.fixture.TestVectors.AUTH_HMAC_SHA512256;
import static org.abstractj.kalium.fixture.TestVectors.AUTH_KEY;
import static org.abstractj.kalium.fixture.TestVectors.AUTH_MESSAGE;
import static org.junit.Assert.fail;
        }
    }

    @Test
    public void testSignMessageAsBytes() throws Exception {
        byte[] rawKey = HEX.decode(AUTH_KEY);
        AuthenticationKey key = new AuthenticationKey(rawKey);
        byte[] mac = key.sign(HEX.decode(AUTH_MESSAGE));
        assertTrue("Message sign has failed", Arrays.equals(HEX.decode(AUTH_HMAC_SHA512256), mac));
    }

    @Test
    public void testSignMessageAsHex() throws Exception {
        AuthenticationKey key = new AuthenticationKey(AUTH_KEY, HEX);
        String mac = key.sign(AUTH_MESSAGE, HEX);
        assertEquals("Message sign has failed", AUTH_HMAC_SHA512256, mac);
    }

    @Test
    public void testVerifyCorrectRawSignature() throws Exception {
        byte[] rawSignature = HEX.decode(AUTH_HMAC_SHA512256);
        byte[] rawMessage = HEX.decode(AUTH_MESSAGE);
        byte[] rawKey = HEX.decode(AUTH_KEY);
        AuthenticationKey authKey = new AuthenticationKey(rawKey);
        assertTrue(authKey.verify(rawMessage, rawSignature));
    }

    @Test
    public void testVerifyCorrectHexSignature() throws Exception {
        AuthenticationKey authKey = new AuthenticationKey(AUTH_KEY, HEX);
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String AUTH_HMAC_SHA512256 = "b2a31b8d4e01afcab2ee545b5caf4e3d212a99d7b3a116a97cec8e83c32e107d";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String AUTH_KEY = "eea6a7251c1e72916d11c2cb214d3c252539121d8e234e652d651fa4c8cff880";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String AUTH_MESSAGE = "8e993b9f48681273c29650ba32fc76ce48332ea7164d96a4476fb8c531a1186a" +
//         "c0dfc17c98dce87b4da7f011ec48c97271d2c20f9b928fe2270d6fb863d51738" +
//         "b48eeee314a7cc8ab932164548e526ae90224368517acfeabd6bb3732bc0e9da" +
//         "99832b61ca01b6de56244a9e88d5f9b37973f622a43d14a6599b1f654cb45a74" +
//         "e355a5";


// Path: src/test/java/org/abstractj/kalium/keys/AuthenticationKeyTest.java
import org.junit.Test;
import java.util.Arrays;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import static org.abstractj.kalium.NaCl.Sodium.CRYPTO_AUTH_HMACSHA512256_KEYBYTES;
import static org.abstractj.kalium.encoders.Encoder.HEX;
import static org.abstractj.kalium.fixture.TestVectors.AUTH_HMAC_SHA512256;
import static org.abstractj.kalium.fixture.TestVectors.AUTH_KEY;
import static org.abstractj.kalium.fixture.TestVectors.AUTH_MESSAGE;
import static org.junit.Assert.fail;

        }
    }

    @Test
    public void testSignMessageAsBytes() throws Exception {
        byte[] rawKey = HEX.decode(AUTH_KEY);
        AuthenticationKey key = new AuthenticationKey(rawKey);
        byte[] mac = key.sign(HEX.decode(AUTH_MESSAGE));
        assertTrue("Message sign has failed", Arrays.equals(HEX.decode(AUTH_HMAC_SHA512256), mac));
    }

    @Test
    public void testSignMessageAsHex() throws Exception {
        AuthenticationKey key = new AuthenticationKey(AUTH_KEY, HEX);
        String mac = key.sign(AUTH_MESSAGE, HEX);
        assertEquals("Message sign has failed", AUTH_HMAC_SHA512256, mac);
    }

    @Test
    public void testVerifyCorrectRawSignature() throws Exception {
        byte[] rawSignature = HEX.decode(AUTH_HMAC_SHA512256);
        byte[] rawMessage = HEX.decode(AUTH_MESSAGE);
        byte[] rawKey = HEX.decode(AUTH_KEY);
        AuthenticationKey authKey = new AuthenticationKey(rawKey);
        assertTrue(authKey.verify(rawMessage, rawSignature));
    }

    @Test
    public void testVerifyCorrectHexSignature() throws Exception {
        AuthenticationKey authKey = new AuthenticationKey(AUTH_KEY, HEX);
        assertTrue(authKey.verify(AUTH_MESSAGE, AUTH_HMAC_SHA512256, HEX));