// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIPHASH24_KEY = "000102030405060708090a0b0c0d0e0f";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIPHASH24_MESSAGE = "000102030405060708090a0b0c0d0e";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIPHASH24_DIGEST = "e545be4961ca29a1";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIPHASH24_DIGEST_EMPTY_STRING = "310e0edd47db6f72";


import org.junit.Test;
import static org.abstractj.kalium.encoders.Encoder.HEX;
import static org.abstractj.kalium.fixture.TestVectors.SIPHASH24_KEY;
import static org.abstractj.kalium.fixture.TestVectors.SIPHASH24_MESSAGE;
import static org.abstractj.kalium.fixture.TestVectors.SIPHASH24_DIGEST;
import static org.abstractj.kalium.fixture.TestVectors.SIPHASH24_DIGEST_EMPTY_STRING;
import static org.junit.Assert.assertEquals;
/**
 * Copyright 2017 Bruno Oliveira, and individual contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.abstractj.kalium.crypto;




public class ShortHashTest {

    private final ShortHash hash = new ShortHash();

    @Test
    public void testSiphash24() throws Exception {
        byte[] message = HEX.decode(SIPHASH24_MESSAGE);
        byte[] key = HEX.decode(SIPHASH24_KEY);
        String result = HEX.encode(hash.siphash24(message, key));
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIPHASH24_KEY = "000102030405060708090a0b0c0d0e0f";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIPHASH24_MESSAGE = "000102030405060708090a0b0c0d0e";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIPHASH24_DIGEST = "e545be4961ca29a1";
// 
// Path: src/test/java/org/abstractj/kalium/fixture/TestVectors.java
// public static final String SIPHASH24_DIGEST_EMPTY_STRING = "310e0edd47db6f72";


// Path: src/test/java/org/abstractj/kalium/crypto/ShortHashTest.java
import org.junit.Test;
import static org.abstractj.kalium.encoders.Encoder.HEX;
import static org.abstractj.kalium.fixture.TestVectors.SIPHASH24_KEY;
import static org.abstractj.kalium.fixture.TestVectors.SIPHASH24_MESSAGE;
import static org.abstractj.kalium.fixture.TestVectors.SIPHASH24_DIGEST;
import static org.abstractj.kalium.fixture.TestVectors.SIPHASH24_DIGEST_EMPTY_STRING;
import static org.junit.Assert.assertEquals;

/**
 * Copyright 2017 Bruno Oliveira, and individual contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.abstractj.kalium.crypto;




public class ShortHashTest {

    private final ShortHash hash = new ShortHash();

    @Test
    public void testSiphash24() throws Exception {
        byte[] message = HEX.decode(SIPHASH24_MESSAGE);
        byte[] key = HEX.decode(SIPHASH24_KEY);
        String result = HEX.encode(hash.siphash24(message, key));
        assertEquals("Hash is invalid", SIPHASH24_DIGEST, result);