<commit_before>#!/usr/bin/env node

var fs = require ('fs');

var lib = fs.readFileSync("./crypto-min.js");
eval(lib.toString());

function make_wa_from_byte(byte, n) {
    var v = [];
    var i;
    var word = (byte << 24) | (byte << 16) | (byte << 8) | byte;
    for (i = 0; i < n/4; i++) {
        v[i] = word;
    }
    var ret = CryptoJS.lib.WordArray.create(v);
    return ret;
}

function repeat_string (s, n) {
    var v = [];
    var i;
    for (i = 0; i < n; i++) {
        v[i] = s;
    }
    return v.join("");
}

function make_wa_from_bytes_between(a,b) {
    var v = [];
    while (a < b) {
        var word = (a++ << 24) | ((a++) << 16) | ((a++) << 8) | (a++);
        v.push(word);
    }
    return CryptoJS.lib.WordArray.create(v);
}

// Test vectors from http://tools.ietf.org/rfc/rfc4868.txt
// Test vectors from http://tools.ietf.org/html/rfc4231.txt

var test_vectors = [
    { "rfc" : 4231,
      "case" : 3,
      "key" : make_wa_from_byte (0xaa, 20),
      "data" : make_wa_from_byte (0xdd, 50),
      "res" : "fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39bf3e848279a722c806b485a47e67c807b946a337bee8942674278859e13292fb"<commit_msg>woa, more test vector progress!<commit_after>#!/usr/bin/env node

var fs = require ('fs');

var lib = fs.readFileSync("./crypto-min.js");
eval(lib.toString());

function make_wa_from_byte(byte, n) {
    var v = [];
    var i;
    var word = (byte << 24) | (byte << 16) | (byte << 8) | byte;
    for (i = 0; i < (n >> 2); i++) {
        v.push(word);
    }
    var ret = CryptoJS.lib.WordArray.create(v);
    if (n % 4 !== 0) {
        word = 0;
        for (i = 0; i < n % 4; i++) {
            word |= (byte << (8*(3 - i)));
        }
        ret.concat(CryptoJS.lib.WordArray.create([word], n%4));
    }
    return ret;
}

function repeat_string (s, n) {
    var v = [];
    var i;
    for (i = 0; i < n; i++) {
        v[i] = s;
    }
    return v.join("");
}

function make_wa_from_bytes_between(a,b) {
    var v = [];
    while (a < b) {
        var word = (a++ << 24) | ((a++) << 16) | ((a++) << 8) | (a++);
        v.push(word);
    }
    return CryptoJS.lib.WordArray.create(v);
}

// Test vectors from http://tools.ietf.org/rfc/rfc4868.txt
// Test vectors from http://tools.ietf.org/html/rfc4231.txt

var test_vectors = [
    { "rfc" : 4231,
      "case" : 3,
      "key" : make_wa_from_byte (0xaa, 20),
      "data" : make_wa_from_byte (0xdd, 50),
      "res" : "fa73b0089d56a28<KEY>"
{'fraction_non_alphanumeric': 0.19676113360323888, 'fraction_numerical': 0.0680161943319838, 'mean_word_length': 2.384931506849315, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 6, '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': '7195367', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1027, 'n_words': 222}