<commit_before>package com.neilalexander.jnacl.crypto.auth;

import org.testng.annotations.Test;

import static com.neilalexander.jnacl.NaCl.asHex;
import static org.fest.assertions.Assertions.assertThat;

public class hmacsha256Test {

  private static byte[] secret = "<KEY>".getBytes();
  private static byte[] message = "a secret message".getBytes();

  @Test
  public void happy_path() throws Exception {
    byte[] buf = new byte[32];
    hmacsha256.crypto_auth(buf, message, message.length, secret);

    assertThat(asHex(buf)).isEqualTo("04E1A5D1EDD8585C7C5ACD6E487F336A8ED50DE2DDB6946DAD8EE26BCE6DD54C");
  }

}<commit_msg>added one more test from nacl test suite<commit_after>package com.neilalexander.jnacl.crypto.auth;

import org.testng.annotations.Test;

import static com.neilalexander.jnacl.NaCl.asHex;
import static org.fest.assertions.Assertions.assertThat;

public class hmacsha256Test {

  private static byte[] secret = "<KEY>".getBytes();
  private static byte[] message = "a secret message".getBytes();

  @Test
  public void happy_path() throws Exception {
    byte[] buf = new byte[32];
    hmacsha256.crypto_auth(buf, message, message.length, secret);

    assertThat(asHex(buf)).isEqualTo("04E1A5D1EDD8585C7C5ACD6E487F336A8ED50DE2DDB6946DAD8EE26BCE6DD54C");
  }

  @Test
  public void auth2() {
    byte[] key = new byte[]{
        0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
        , 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10
        , 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18
        , 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20
    };

    byte[] c = new byte[]{
        (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd
        , (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd
        , (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd
        , (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd
        , (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd
        , (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd, (byte) 0xcd
        , (byte) 0xcd, (byte) 0xcd
    };

    byte[] a = new byte[32];

    hmacsha256.crypto_auth(a, c, c.length, key);

    assertThat(a).isEqualTo(new byte[]{
        (byte) 0x37, (byte) 0x2e, (byte) 0xfc, (byte) 0xf9, (byte) 0xb4, (byte) 0x0b, (byte) 0x35, (byte) 0xc2
        , (byte) 0x11, (byte) 0x5b, (byte) 0x13, (byte) 0x46, (byte) 0x90, (byte) 0x3d, (byte) 0x2e, (byte) 0xf4
        , (byte) 0x2f, (byte) 0xce, (byte) 0xd4, (byte) 0x6f, (byte) 0x08, (byte) 0x46, (byte) 0xe7, (byte) 0x25
        , (byte) 0x7b, (byte) 0xb1, (byte) 0x56, (byte) 0xd3, (byte) 0xd7, (byte) 0xb3, (byte) 0x0d, (byte) 0x3f
    });
  }

}
{'fraction_non_alphanumeric': 0.15986277873070326, 'fraction_numerical': 0.10017152658662093, 'mean_word_length': 3.8438538205980066, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2498128', 'n_tokens_mistral': 1487, 'n_tokens_neox': 1292, 'n_words': 305}