<commit_before>package org.bouncycastle.crypto.test;

import java.security.SecureRandom;

import org.bouncycastle.crypto.BlockCipher;
import org.bouncycastle.crypto.engines.ARIAEngine;
import org.bouncycastle.crypto.params.KeyParameter;
import org.bouncycastle.util.Arrays;
import org.bouncycastle.util.encoders.Hex;
import org.bouncycastle.util.test.SimpleTest;

public class ARIATest
    extends SimpleTest
{
    private static SecureRandom R = new SecureRandom();

    private static final String[][] TEST_VECTORS_RFC5794 = {
        {
            "128-Bit Key",
            "<KEY>",
            "<KEY>",
            "<KEY>"
        },
        {
            "192-Bit Key",
            "<KEY>",
            "<KEY>",
            "26449c1805dbe7aa25a468ce263a9e79"
        },
        {
            "256-Bit Key",
            "<KEY>",
            "<KEY>",
            "<KEY>"
        },
    };

    public String getName()
    {
        return "ARIA";
    }

    public void performTest() throws Exception
    {
        checkTestVectors_RFC5794();
        long before = System.currentTimeMillis();
        for (int i = 0; i < 10000; ++i)
        {
        checkRandomRoundtrips();
        }
        long after = System.currentTimeMillis();
        long elapsed = after - before;
        System.out.println("Elapsed: " + elapsed + "ms.");

        new MyARIAEngine().checkImplementation();
    }

    private void checkRandomRoundtrips()
    {
        ARIAEngine ce = new ARIAEngine();
        ARIAEngine cd = new ARIAEngine();

        byte[] txt = new byte[ce.getBlockSize()];
        byte[] enc = new byte[ce.getBlockSize()];
        byte[] dec = new byte[ce.getBlockSize()];

        for (int keyLen = 16; keyLen <= 32; keyLen += 8)
        {
            byte[] K = new byte[keyLen];

            R.nextBytes(K);

            KeyParameter key = new KeyParameter(K);
            ce.init(true, key);
            cd.init(false, key);<commit_msg>Remove debugging code from ARIATest<commit_after>package org.bouncycastle.crypto.test;

import java.security.SecureRandom;

import org.bouncycastle.crypto.BlockCipher;
import org.bouncycastle.crypto.engines.ARIAEngine;
import org.bouncycastle.crypto.params.KeyParameter;
import org.bouncycastle.util.Arrays;
import org.bouncycastle.util.encoders.Hex;
import org.bouncycastle.util.test.SimpleTest;

public class ARIATest
    extends SimpleTest
{
    private static SecureRandom R = new SecureRandom();

    private static final String[][] TEST_VECTORS_RFC5794 = {
        {
            "128-Bit Key",
            "000102030405060708090a0b0c0d0e0f",
            "00112233445566778899aabbccddeeff",
            "d718fbd6ab644c739da95f3be6451778"
        },
        {
            "192-Bit Key",
            "<KEY>",
            "<KEY>",
            "26449c1805dbe7aa25a468ce263a9e79"
        },
        {
            "256-Bit Key",
            "<KEY>",
            "<KEY>",
            "<KEY>"
        },
    };

    public String getName()
    {
        return "ARIA";
    }

    public void performTest() throws Exception
    {
        checkTestVectors_RFC5794();

        for (int i = 0; i < 100; ++i)
        {
            checkRandomRoundtrips();
        }

        new MyARIAEngine().checkImplementation();
    }

    private void checkRandomRoundtrips()
    {
        ARIAEngine ce = new ARIAEngine();
        ARIAEngine cd = new ARIAEngine();

        byte[] txt = new byte[ce.getBlockSize()];
        byte[] enc = new byte[ce.getBlockSize()];
        byte[] dec = new byte[ce.getBlockSize()];

        for (int keyLen = 16; keyLen <= 32; keyLen += 8)
        {
            byte[] K = new byte[keyLen];

            R.nextBytes(K);

            KeyParameter key = new KeyParameter(K);
            ce.init(true, key);
            cd.init(false, key);
{'fraction_non_alphanumeric': 0.1195680800632078, 'fraction_numerical': 0.04266526204898604, 'mean_word_length': 1.9811616954474098, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 16, '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': '5450049', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1186, 'n_words': 240}