2018-05-14 17:33:16 +00:00
|
|
|
/* eslint no-console: 0 */
|
|
|
|
|
|
|
|
/**
|
2018-05-17 15:11:34 +00:00
|
|
|
* Test Runner
|
2018-05-14 17:33:16 +00: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 10:29:27 +00:00
|
|
|
import {
|
|
|
|
setLongTestFailure,
|
|
|
|
logTestReport,
|
2019-09-04 16:13:05 +00:00
|
|
|
} from "../lib/utils.mjs";
|
2018-05-14 17:33:16 +00:00
|
|
|
|
2019-07-09 11:23:59 +00:00
|
|
|
import TestRegister from "../lib/TestRegister.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/BCD.mjs";
|
|
|
|
import "./tests/BSON.mjs";
|
|
|
|
import "./tests/BaconCipher.mjs";
|
2021-09-11 15:03:59 +00:00
|
|
|
import "./tests/Base45.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/Base58.mjs";
|
|
|
|
import "./tests/Base64.mjs";
|
|
|
|
import "./tests/Base62.mjs";
|
2022-06-14 09:23:13 +00:00
|
|
|
import "./tests/Base85.mjs";
|
2023-04-12 05:07:16 +00:00
|
|
|
import "./tests/Base92.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/BitwiseOp.mjs";
|
|
|
|
import "./tests/ByteRepr.mjs";
|
|
|
|
import "./tests/CartesianProduct.mjs";
|
2022-01-17 10:37:24 +00:00
|
|
|
import "./tests/CetaceanCipherEncode.mjs";
|
|
|
|
import "./tests/CetaceanCipherDecode.mjs";
|
2022-11-03 13:47:40 +00:00
|
|
|
import "./tests/ChaCha.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/CharEnc.mjs";
|
|
|
|
import "./tests/ChangeIPFormat.mjs";
|
|
|
|
import "./tests/Charts.mjs";
|
|
|
|
import "./tests/Checksum.mjs";
|
|
|
|
import "./tests/Ciphers.mjs";
|
|
|
|
import "./tests/Code.mjs";
|
|
|
|
import "./tests/Comment.mjs";
|
|
|
|
import "./tests/Compress.mjs";
|
|
|
|
import "./tests/ConditionalJump.mjs";
|
|
|
|
import "./tests/Crypt.mjs";
|
|
|
|
import "./tests/CSV.mjs";
|
|
|
|
import "./tests/DateTime.mjs";
|
|
|
|
import "./tests/ExtractEmailAddresses.mjs";
|
|
|
|
import "./tests/Fork.mjs";
|
|
|
|
import "./tests/FromDecimal.mjs";
|
2022-09-22 15:30:36 +00:00
|
|
|
import "./tests/GenerateAllHashes.mjs";
|
2019-12-17 12:15:11 +00:00
|
|
|
import "./tests/Gzip.mjs";
|
2019-12-17 12:28:09 +00:00
|
|
|
import "./tests/Gunzip.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/Hash.mjs";
|
|
|
|
import "./tests/HaversineDistance.mjs";
|
2020-01-18 00:21:15 +00:00
|
|
|
import "./tests/Hex.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/Hexdump.mjs";
|
|
|
|
import "./tests/Image.mjs";
|
|
|
|
import "./tests/IndexOfCoincidence.mjs";
|
|
|
|
import "./tests/Jump.mjs";
|
|
|
|
import "./tests/JSONBeautify.mjs";
|
|
|
|
import "./tests/JSONMinify.mjs";
|
|
|
|
import "./tests/JSONtoCSV.mjs";
|
|
|
|
import "./tests/JWTDecode.mjs";
|
|
|
|
import "./tests/JWTSign.mjs";
|
|
|
|
import "./tests/JWTVerify.mjs";
|
2023-12-25 00:17:16 +00:00
|
|
|
import "./tests/LZNT1Decompress.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/MS.mjs";
|
|
|
|
import "./tests/Magic.mjs";
|
|
|
|
import "./tests/MorseCode.mjs";
|
2024-02-06 18:03:15 +00:00
|
|
|
import "./tests/MurmurHash3.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/NetBIOS.mjs";
|
2019-11-25 21:53:31 +00:00
|
|
|
import "./tests/NormaliseUnicode.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/OTP.mjs";
|
|
|
|
import "./tests/PGP.mjs";
|
|
|
|
import "./tests/PHP.mjs";
|
|
|
|
import "./tests/ParseIPRange.mjs";
|
|
|
|
import "./tests/ParseQRCode.mjs";
|
2021-11-07 10:21:17 +00:00
|
|
|
import "./tests/PEMtoHex.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/PowerSet.mjs";
|
|
|
|
import "./tests/Regex.mjs";
|
|
|
|
import "./tests/Register.mjs";
|
|
|
|
import "./tests/Rotate.mjs";
|
|
|
|
import "./tests/SeqUtils.mjs";
|
|
|
|
import "./tests/SetDifference.mjs";
|
|
|
|
import "./tests/SetIntersection.mjs";
|
|
|
|
import "./tests/SetUnion.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-23 23:58:54 +00:00
|
|
|
import "./tests/SM4.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/StrUtils.mjs";
|
|
|
|
import "./tests/SymmetricDifference.mjs";
|
|
|
|
import "./tests/TextEncodingBruteForce.mjs";
|
|
|
|
import "./tests/TranslateDateTimeFormat.mjs";
|
|
|
|
import "./tests/Magic.mjs";
|
|
|
|
import "./tests/ParseTLV.mjs";
|
|
|
|
import "./tests/Media.mjs";
|
|
|
|
import "./tests/ToFromInsensitiveRegex.mjs";
|
2019-01-15 16:24:29 +00:00
|
|
|
import "./tests/YARA.mjs";
|
2019-09-04 16:13:05 +00:00
|
|
|
import "./tests/ConvertCoordinateFormat.mjs";
|
|
|
|
import "./tests/Enigma.mjs";
|
|
|
|
import "./tests/Bombe.mjs";
|
|
|
|
import "./tests/MultipleBombe.mjs";
|
|
|
|
import "./tests/Typex.mjs";
|
|
|
|
import "./tests/BLAKE2b.mjs";
|
|
|
|
import "./tests/BLAKE2s.mjs";
|
|
|
|
import "./tests/Protobuf.mjs";
|
|
|
|
import "./tests/ParseSSHHostKey.mjs";
|
|
|
|
import "./tests/DefangIP.mjs";
|
|
|
|
import "./tests/ParseUDP.mjs";
|
2022-05-30 17:06:15 +00:00
|
|
|
import "./tests/ParseTCP.mjs";
|
2019-10-31 14:17:07 +00:00
|
|
|
import "./tests/AvroToJSON.mjs";
|
2019-10-29 21:39:29 +00:00
|
|
|
import "./tests/Lorenz.mjs";
|
2020-02-26 10:55:15 +00:00
|
|
|
import "./tests/LuhnChecksum.mjs";
|
2020-03-05 15:25:10 +00:00
|
|
|
import "./tests/CipherSaber2.mjs";
|
2019-12-04 22:43:22 +00:00
|
|
|
import "./tests/Colossus.mjs";
|
2020-03-27 11:56:42 +00:00
|
|
|
import "./tests/ParseObjectIDTimestamp.mjs";
|
2020-08-19 09:55:29 +00:00
|
|
|
import "./tests/Unicode.mjs";
|
2021-02-01 19:15:32 +00:00
|
|
|
import "./tests/RSA.mjs";
|
2020-03-26 11:44:57 +00:00
|
|
|
import "./tests/CBOREncode.mjs";
|
2020-03-28 20:13:49 +00:00
|
|
|
import "./tests/CBORDecode.mjs";
|
2023-04-12 09:39:07 +00:00
|
|
|
import "./tests/RisonEncodeDecode.mjs";
|
2021-08-10 13:57:34 +00:00
|
|
|
import "./tests/JA3Fingerprint.mjs";
|
2021-08-10 15:48:35 +00:00
|
|
|
import "./tests/JA3SFingerprint.mjs";
|
|
|
|
import "./tests/HASSH.mjs";
|
2020-07-06 10:20:54 +00:00
|
|
|
import "./tests/GetAllCasings.mjs";
|
2020-06-07 16:45:17 +00:00
|
|
|
import "./tests/SIGABA.mjs";
|
2022-06-05 17:35:02 +00:00
|
|
|
import "./tests/ELFInfo.mjs";
|
2022-06-17 08:17:28 +00:00
|
|
|
import "./tests/Subsection.mjs";
|
2020-07-06 15:35:14 +00:00
|
|
|
import "./tests/CaesarBoxCipher.mjs";
|
2022-09-29 03:32:21 +00:00
|
|
|
import "./tests/UnescapeString.mjs";
|
2020-02-14 12:28:12 +00:00
|
|
|
import "./tests/LS47.mjs";
|
2021-10-29 06:31:55 +00:00
|
|
|
import "./tests/LZString.mjs";
|
2022-09-27 21:13:22 +00:00
|
|
|
import "./tests/NTLM.mjs";
|
2022-11-11 13:26:41 +00:00
|
|
|
import "./tests/Shuffle.mjs";
|
2022-11-02 12:54:45 +00:00
|
|
|
import "./tests/FletcherChecksum.mjs";
|
2022-11-01 17:07:16 +00:00
|
|
|
import "./tests/CMAC.mjs";
|
2022-10-31 15:35:27 +00:00
|
|
|
import "./tests/AESKeyWrap.mjs";
|
2022-11-25 16:48:54 +00:00
|
|
|
import "./tests/Rabbit.mjs";
|
2023-01-10 20:16:37 +00:00
|
|
|
import "./tests/LevenshteinDistance.mjs";
|
2023-01-10 20:48:05 +00:00
|
|
|
import "./tests/SwapCase.mjs";
|
2023-03-17 14:49:06 +00:00
|
|
|
import "./tests/HKDF.mjs";
|
2023-03-24 22:33:43 +00:00
|
|
|
import "./tests/GenerateDeBruijnSequence.mjs";
|
2023-07-14 17:37:02 +00:00
|
|
|
import "./tests/GOST.mjs";
|
2018-05-14 17:33:16 +00:00
|
|
|
|
2018-12-26 16:33:10 +00:00
|
|
|
// Cannot test operations that use the File type yet
|
2019-09-04 16:13:05 +00:00
|
|
|
// import "./tests/SplitColourChannels.mjs";
|
2021-02-01 19:15:32 +00:00
|
|
|
|
2019-01-04 10:29:27 +00:00
|
|
|
const testStatus = {
|
|
|
|
allTestsPassing: true,
|
|
|
|
counts: {
|
|
|
|
total: 0,
|
2018-05-14 17:33:16 +00:00
|
|
|
}
|
2017-05-02 23:40:39 +00:00
|
|
|
};
|
2018-05-14 17:33:16 +00:00
|
|
|
|
2019-01-04 10:29:27 +00:00
|
|
|
setLongTestFailure();
|
2018-05-14 17:33:16 +00:00
|
|
|
|
2019-01-04 10:29:27 +00:00
|
|
|
const logOpsTestReport = logTestReport.bind(null, testStatus);
|
2018-05-14 17:33:16 +00:00
|
|
|
|
2020-03-13 14:59:48 +00:00
|
|
|
(async function() {
|
|
|
|
const results = await TestRegister.runTests();
|
|
|
|
logOpsTestReport(results);
|
|
|
|
})();
|