2018-05-14 19:33:16 +02:00
|
|
|
/* eslint no-console: 0 */
|
|
|
|
|
|
|
|
/**
|
2018-05-17 17:11:34 +02:00
|
|
|
* Test Runner
|
2018-05-14 19:33:16 +02:00
|
|
|
*
|
|
|
|
* For running the tests in the test register.
|
|
|
|
*
|
|
|
|
* @author tlwr [toby@toby.codes]
|
|
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
|
|
* @copyright Crown Copyright 2017
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
import {
|
|
|
|
setLongTestFailure,
|
|
|
|
logTestReport,
|
2019-09-04 18:13:05 +02:00
|
|
|
} from "../lib/utils.mjs";
|
2018-05-14 19:33:16 +02:00
|
|
|
|
2019-07-09 13:23:59 +02:00
|
|
|
import TestRegister from "../lib/TestRegister.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/AESKeyWrap.mjs";
|
|
|
|
import "./tests/AvroToJSON.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/BaconCipher.mjs";
|
2021-09-11 17:03:59 +02:00
|
|
|
import "./tests/Base45.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Base58.mjs";
|
|
|
|
import "./tests/Base62.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/Base64.mjs";
|
2022-06-14 11:23:13 +02:00
|
|
|
import "./tests/Base85.mjs";
|
2023-04-12 07:07:16 +02:00
|
|
|
import "./tests/Base92.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/BCD.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/BitwiseOp.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/BLAKE2b.mjs";
|
|
|
|
import "./tests/BLAKE2s.mjs";
|
|
|
|
import "./tests/Bombe.mjs";
|
|
|
|
import "./tests/BSON.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/ByteRepr.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/CaesarBoxCipher.mjs";
|
2024-02-13 10:22:54 +01:00
|
|
|
import "./tests/CaretMdecode.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/CartesianProduct.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/CBORDecode.mjs";
|
|
|
|
import "./tests/CBOREncode.mjs";
|
2022-01-17 11:37:24 +01:00
|
|
|
import "./tests/CetaceanCipherDecode.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/CetaceanCipherEncode.mjs";
|
2022-11-03 14:47:40 +01:00
|
|
|
import "./tests/ChaCha.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/ChangeIPFormat.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/CharEnc.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Charts.mjs";
|
|
|
|
import "./tests/Checksum.mjs";
|
|
|
|
import "./tests/Ciphers.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/CipherSaber2.mjs";
|
|
|
|
import "./tests/CMAC.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Code.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/Colossus.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Comment.mjs";
|
|
|
|
import "./tests/Compress.mjs";
|
|
|
|
import "./tests/ConditionalJump.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/ConvertCoordinateFormat.mjs";
|
|
|
|
import "./tests/ConvertToNATOAlphabet.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Crypt.mjs";
|
|
|
|
import "./tests/CSV.mjs";
|
|
|
|
import "./tests/DateTime.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/DefangIP.mjs";
|
|
|
|
import "./tests/ELFInfo.mjs";
|
|
|
|
import "./tests/Enigma.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/ExtractEmailAddresses.mjs";
|
2024-04-02 04:22:43 +02:00
|
|
|
import "./tests/ExtractHashes.mjs";
|
2019-10-07 14:02:28 +02:00
|
|
|
import "./tests/Float.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/FileTree.mjs";
|
|
|
|
import "./tests/FletcherChecksum.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Fork.mjs";
|
|
|
|
import "./tests/FromDecimal.mjs";
|
2022-09-22 17:30:36 +02:00
|
|
|
import "./tests/GenerateAllHashes.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/GenerateDeBruijnSequence.mjs";
|
|
|
|
import "./tests/GetAllCasings.mjs";
|
|
|
|
import "./tests/GOST.mjs";
|
2019-12-17 13:28:09 +01:00
|
|
|
import "./tests/Gunzip.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/Gzip.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Hash.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/HASSH.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/HaversineDistance.mjs";
|
2020-01-18 01:21:15 +01:00
|
|
|
import "./tests/Hex.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Hexdump.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/HKDF.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Image.mjs";
|
|
|
|
import "./tests/IndexOfCoincidence.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/JA3Fingerprint.mjs";
|
2024-04-12 15:41:00 +02:00
|
|
|
import "./tests/JA4.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/JA3SFingerprint.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/JSONBeautify.mjs";
|
|
|
|
import "./tests/JSONMinify.mjs";
|
|
|
|
import "./tests/JSONtoCSV.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/Jump.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/JWTDecode.mjs";
|
|
|
|
import "./tests/JWTSign.mjs";
|
|
|
|
import "./tests/JWTVerify.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/LevenshteinDistance.mjs";
|
|
|
|
import "./tests/Lorenz.mjs";
|
|
|
|
import "./tests/LS47.mjs";
|
|
|
|
import "./tests/LuhnChecksum.mjs";
|
2023-12-25 01:17:16 +01:00
|
|
|
import "./tests/LZNT1Decompress.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/LZString.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Magic.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/Media.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/MorseCode.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/MS.mjs";
|
|
|
|
import "./tests/MultipleBombe.mjs";
|
2024-02-06 19:03:15 +01:00
|
|
|
import "./tests/MurmurHash3.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/NetBIOS.mjs";
|
2019-11-25 22:53:31 +01:00
|
|
|
import "./tests/NormaliseUnicode.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/NTLM.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/OTP.mjs";
|
|
|
|
import "./tests/ParseIPRange.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/ParseObjectIDTimestamp.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/ParseQRCode.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/ParseSSHHostKey.mjs";
|
|
|
|
import "./tests/ParseTCP.mjs";
|
|
|
|
import "./tests/ParseTLV.mjs";
|
|
|
|
import "./tests/ParseUDP.mjs";
|
2021-11-07 11:21:17 +01:00
|
|
|
import "./tests/PEMtoHex.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/PGP.mjs";
|
|
|
|
import "./tests/PHP.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/PowerSet.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/Protobuf.mjs";
|
2023-10-14 23:42:02 +02:00
|
|
|
import "./tests/PubKeyFromCert.mjs";
|
2023-10-15 00:06:46 +02:00
|
|
|
import "./tests/PubKeyFromPrivKey.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/Rabbit.mjs";
|
2024-02-13 12:52:19 +01:00
|
|
|
import "./tests/RAKE.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Regex.mjs";
|
|
|
|
import "./tests/Register.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/RisonEncodeDecode.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Rotate.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/RSA.mjs";
|
2024-03-10 16:42:33 +01:00
|
|
|
import "./tests/Salsa20.mjs";
|
|
|
|
import "./tests/XSalsa20.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/SeqUtils.mjs";
|
|
|
|
import "./tests/SetDifference.mjs";
|
|
|
|
import "./tests/SetIntersection.mjs";
|
|
|
|
import "./tests/SetUnion.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/Shuffle.mjs";
|
|
|
|
import "./tests/SIGABA.mjs";
|
Add the SM4 block cipher, also a no-padding option for block ciphers.
This adds an implementation of the SM4 block cipher, and operations
to encrypt and decrypt using it with CBC,ECB,CFB,OFB,CTR modes.
Also, a "no padding" option is added for AES,DES,3DES and SM4
decryption in ECB/CBC modes. This variant does not attempt to
validate the last block as being PKCS#7 padded.
This is useful, both since other padding schemes exist, and also
for decrypting data where the final block is missing.
2021-03-24 00:58:54 +01:00
|
|
|
import "./tests/SM4.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
// import "./tests/SplitColourChannels.mjs"; // Cannot test operations that use the File type yet
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/StrUtils.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/Subsection.mjs";
|
|
|
|
import "./tests/SwapCase.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/SymmetricDifference.mjs";
|
|
|
|
import "./tests/TextEncodingBruteForce.mjs";
|
|
|
|
import "./tests/ToFromInsensitiveRegex.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/TranslateDateTimeFormat.mjs";
|
2019-09-04 18:13:05 +02:00
|
|
|
import "./tests/Typex.mjs";
|
2022-09-29 05:32:21 +02:00
|
|
|
import "./tests/UnescapeString.mjs";
|
2024-02-12 17:52:43 +01:00
|
|
|
import "./tests/Unicode.mjs";
|
|
|
|
import "./tests/YARA.mjs";
|
2023-01-22 01:48:49 +01:00
|
|
|
import "./tests/ParseCSR.mjs";
|
2018-05-14 19:33:16 +02:00
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
const testStatus = {
|
|
|
|
allTestsPassing: true,
|
|
|
|
counts: {
|
|
|
|
total: 0,
|
2018-05-14 19:33:16 +02:00
|
|
|
}
|
2017-05-03 01:40:39 +02:00
|
|
|
};
|
2018-05-14 19:33:16 +02:00
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
setLongTestFailure();
|
2018-05-14 19:33:16 +02:00
|
|
|
|
2019-01-04 11:29:27 +01:00
|
|
|
const logOpsTestReport = logTestReport.bind(null, testStatus);
|
2018-05-14 19:33:16 +02:00
|
|
|
|
2020-03-13 15:59:48 +01:00
|
|
|
(async function() {
|
|
|
|
const results = await TestRegister.runTests();
|
|
|
|
logOpsTestReport(results);
|
|
|
|
})();
|