<commit_before><?php

declare(strict_types=1);

/*
 * Generates the openssl-related test vectors in tests/.vectors.json
 */

use Dcrypt\OpensslStatic;

require __DIR__.'/../vendor/autoload.php';

$vectors = __DIR__.'/../tests/.vectors.json';

if (file_exists($vectors)) {
    $key = json_decode(file_get_contents($vectors))->key;
} else {
    $key = \Dcrypt\OpensslKey::create();
}

$out = [
    'key'     => $key,
    'algos'   => [],
    'ciphers' => [],
    'aes256'  => [],
    'otp'     => [],
];

foreach (\Dcrypt\OpensslSupported::ciphers() as $cipher) {
    if (strtolower($cipher) !== $cipher) {
        continue;
    }

    try {
        $out['ciphers'][$cipher] = base64_encode(OpensslStatic::encrypt('a secret', $key, $cipher, 'sha3-256'));
    } catch (\Exception | \Error $e) {
    }<commit_msg>Apply fixes from StyleCI (#29)<commit_after><?php

declare(strict_types=1);

/*
 * Generates the openssl-related test vectors in tests/.vectors.json
 */

use Dcrypt\OpensslStatic;

require __DIR__.'/../vendor/autoload.php';

$vectors = __DIR__.'/../tests/.vectors.json';

if (file_exists($vectors)) {
    $key = json_decode(file_get_contents($vectors))->key;
} else {
    $key = \Dcrypt\OpensslKey::create();
}

$out = [
    'key' => $key,
    'algos' => [],
    'ciphers' => [],
    'aes256' => [],
    'otp' => [],
];

foreach (\Dcrypt\OpensslSupported::ciphers() as $cipher) {
    if (strtolower($cipher) !== $cipher) {
        continue;
    }

    try {
        $out['ciphers'][$cipher] = base64_encode(OpensslStatic::encrypt('a secret', $key, $cipher, 'sha3-256'));
    } catch (\Exception | \Error $e) {
    }
{'fraction_non_alphanumeric': 0.20874384236453203, 'fraction_numerical': 0.013546798029556651, 'mean_word_length': 3.2317708333333335, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '2183854', 'n_tokens_mistral': 643, 'n_tokens_neox': 591, 'n_words': 100}