From 14cda29fd730f41b1a5ffa763b2b03129af01528 Mon Sep 17 00:00:00 2001 From: bee Date: Sun, 24 Jul 2022 19:44:44 +0100 Subject: [PATCH 01/17] Create benchmarking infrastructure for Ares This PR creates a benchmarking infrastructure for our program with a github action that runs for pull requests. There is only 1 benchmark for now, but I will add more later. --- .github/workflows/pull_request.yml | 9 + .gitignore | 4 - Cargo.lock | 838 +++++++++++++++++++++++++++++ Cargo.toml | 5 + benches/benchmark_crackers.rs | 11 + src/crackers/README.md | 1 - src/crackers/mod.rs | 4 - 7 files changed, 863 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/pull_request.yml create mode 100644 Cargo.lock create mode 100644 benches/benchmark_crackers.rs delete mode 100644 src/crackers/README.md delete mode 100644 src/crackers/mod.rs diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 00000000..f1e65735 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,9 @@ +on: [pull_request] +name: benchmark pull requests +jobs: + runBenchmark: + name: run benchmark + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: boa-dev/criterion-compare-action@v3.0.0 diff --git a/.gitignore b/.gitignore index 37c4386b..1d3fe4b2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,6 @@ # will have compiled files and executables /target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - # These are backup files generated by rustfmt **/*.rs.bk diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..49d482b5 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,838 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bit-set" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "bitflags", + "textwrap 0.11.0", + "unicode-width", +] + +[[package]] +name = "clap" +version = "3.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab8b79fe3946ceb4a0b1c080b4018992b8d27e9ff363644c1c9b6387c854614d" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "once_cell", + "strsim", + "termcolor", + "textwrap 0.15.0", +] + +[[package]] +name = "clap_derive" +version = "3.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759bf187376e1afa7b85b959e6a664a3e7a95203415dba952ad19139e798f902" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "criterion" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" +dependencies = [ + "atty", + "cast", + "clap 2.34.0", + "criterion-plot", + "csv", + "itertools", + "lazy_static", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_cbor", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" +dependencies = [ + "cast", + "itertools", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c02a4d71819009c192cf4872265391563fd6a84c81ff2c0f2a7026ca4c1d85c" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07db9d94cbd326813772c968ccd25999e5f8ae22f4f8d1b11effa37ef6ce281d" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "once_cell", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "csv" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" +dependencies = [ + "bstr", + "csv-core", + "itoa 0.4.8", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +dependencies = [ + "memchr", +] + +[[package]] +name = "either" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" + +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "fancy-regex" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0678ab2d46fa5195aaf59ad034c083d351377d4af57f3e073c074d0da3e3c766" +dependencies = [ + "bit-set", + "regex", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "607c8a29735385251a339424dd462993c0fed8fa09d378f259377df08c126022" + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "include_dir" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "482a2e29200b7eed25d7fdbd14423326760b7f6658d21a4cf12d55a50713c69f" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e074c19deab2501407c91ba1860fa3d6820bfde307db6d8cb851b55a10be89b" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" + +[[package]] +name = "js-sys" +version = "0.3.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lemmeknow" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d9e8a3779c5bb53ae995ddf3a1162e6752f18bd4727176b2e4b23b6e28385b" +dependencies = [ + "fancy-regex", + "rayon", + "serde", + "serde_json", +] + +[[package]] +name = "libc" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "os_str_bytes" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4" + +[[package]] +name = "petgraph" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "plotters" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9428003b84df1496fb9d6eeee9c5f8145cb41ca375eb0dad204328888832811f" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" + +[[package]] +name = "plotters-svg" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0918736323d1baff32ee0eade54984f6f201ad7e97d5cfb5d6ab4a358529615" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "project_ares" +version = "0.1.0" +dependencies = [ + "base64", + "clap 3.2.12", + "criterion", + "env_logger", + "include_dir", + "lemmeknow", + "log", + "once_cell", + "petgraph", + "rayon", + "text_io", +] + +[[package]] +name = "quote" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rayon" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +dependencies = [ + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "regex" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + +[[package]] +name = "regex-syntax" +version = "0.6.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" + +[[package]] +name = "ryu" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "serde" +version = "1.0.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +dependencies = [ + "itoa 1.0.2", + "ryu", + "serde", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "text_io" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442f2674e6bd8489052b958e0eaebd89c26eefa3be9dc359d1e2ecccdc510f45" + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "textwrap" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "unicode-ident" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" + +[[package]] +name = "unicode-width" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" + +[[package]] +name = "web-sys" +version = "0.3.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml index 9fd094f8..f392a9af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,8 +26,13 @@ lemmeknow = { version = "0.5", default-features = false } include_dir = "0.7.2" once_cell = "1.13.0" text_io = "0.1.10" +criterion = "0.3.6" [profile.release] lto = "fat" panic = "abort" strip = "symbols" + +[[bench]] +name = "benchmark_crackers" +harness = false diff --git a/benches/benchmark_crackers.rs b/benches/benchmark_crackers.rs new file mode 100644 index 00000000..d3a7c4cc --- /dev/null +++ b/benches/benchmark_crackers.rs @@ -0,0 +1,11 @@ +use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use ares::decoders::base64_decoder::{Base64Decoder}; +use ares::decoders::interface::{Crack, Decoder}; + +pub fn criterion_benchmark(c: &mut Criterion) { + let decode_base64 = Decoder::::new(); + c.bench_function("base64 successful decoding", |b| b.iter(|| decode_base64.crack(black_box("aGVsbG8gd29ybGQ=")))); +} + +criterion_group!(benches, criterion_benchmark); +criterion_main!(benches); \ No newline at end of file diff --git a/src/crackers/README.md b/src/crackers/README.md deleted file mode 100644 index 04140fd2..00000000 --- a/src/crackers/README.md +++ /dev/null @@ -1 +0,0 @@ -Please read [mod.rs](mod.rs) for the latest up to date documentation. \ No newline at end of file diff --git a/src/crackers/mod.rs b/src/crackers/mod.rs deleted file mode 100644 index ea7eba49..00000000 --- a/src/crackers/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -//! This module contains the code for all of the crackers and enables us to run them -//! A cracker is anything that cracks encrypted text -//! Encrypted text is anything that is encrypted with a key. -//! You can call each cracker directly, but it is best to use the searcher for this. From 0cd0b1c46ee4c0b4ccc3be2886a7bae35b2be4a5 Mon Sep 17 00:00:00 2001 From: bee Date: Sun, 24 Jul 2022 19:58:40 +0100 Subject: [PATCH 02/17] Changing to secret --- .github/workflows/pull_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index f1e65735..dde104e2 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -7,3 +7,6 @@ jobs: steps: - uses: actions/checkout@master - uses: boa-dev/criterion-compare-action@v3.0.0 + with: + # Optional. Default is `${{ github.token }}`. + token: ${{ secrets.PERSONAL_TOKEN }} \ No newline at end of file From 85eb536bb40a09515696df13c4ed0fb03f24d5ee Mon Sep 17 00:00:00 2001 From: bee Date: Sun, 24 Jul 2022 20:01:07 +0100 Subject: [PATCH 03/17] Changing to secret --- .github/workflows/pull_request.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index dde104e2..7221edbb 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -8,5 +8,7 @@ jobs: - uses: actions/checkout@master - uses: boa-dev/criterion-compare-action@v3.0.0 with: + # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against + branchName: ${{ github.base_ref }} # Optional. Default is `${{ github.token }}`. token: ${{ secrets.PERSONAL_TOKEN }} \ No newline at end of file From f0d1ce7b45a91852c8621f0401fc1d288c5d6e9a Mon Sep 17 00:00:00 2001 From: bee Date: Sun, 24 Jul 2022 20:03:06 +0100 Subject: [PATCH 04/17] Cargo fmt --- benches/benchmark_crackers.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/benches/benchmark_crackers.rs b/benches/benchmark_crackers.rs index d3a7c4cc..dc78713e 100644 --- a/benches/benchmark_crackers.rs +++ b/benches/benchmark_crackers.rs @@ -1,11 +1,13 @@ -use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use ares::decoders::base64_decoder::{Base64Decoder}; +use ares::decoders::base64_decoder::Base64Decoder; use ares::decoders::interface::{Crack, Decoder}; +use criterion::{black_box, criterion_group, criterion_main, Criterion}; pub fn criterion_benchmark(c: &mut Criterion) { let decode_base64 = Decoder::::new(); - c.bench_function("base64 successful decoding", |b| b.iter(|| decode_base64.crack(black_box("aGVsbG8gd29ybGQ=")))); + c.bench_function("base64 successful decoding", |b| { + b.iter(|| decode_base64.crack(black_box("aGVsbG8gd29ybGQ="))) + }); } criterion_group!(benches, criterion_benchmark); -criterion_main!(benches); \ No newline at end of file +criterion_main!(benches); From de6aeae6cf706e1e3ac6ab8fbbfe69157f0e37b5 Mon Sep 17 00:00:00 2001 From: bee Date: Sun, 24 Jul 2022 20:10:30 +0100 Subject: [PATCH 05/17] made library public --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index d278c366..5999928e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ //! Ares is an automatic decoding and cracking tool. mod checkers; -mod decoders; +pub mod decoders; mod filtration_system; mod searchers; mod storage; From af9308afcb600569730076cd156819515e5e1670 Mon Sep 17 00:00:00 2001 From: bee Date: Sun, 24 Jul 2022 20:20:06 +0100 Subject: [PATCH 06/17] bench is false https://github.com/bheisler/criterion.rs/issues/193 --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index f392a9af..419ea54f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,3 +36,4 @@ strip = "symbols" [[bench]] name = "benchmark_crackers" harness = false +bench = false \ No newline at end of file From 1c987b0244e9734dd04982472fb1065d9eed32d7 Mon Sep 17 00:00:00 2001 From: bee Date: Sun, 24 Jul 2022 20:30:32 +0100 Subject: [PATCH 07/17] bench is false https://github.com/bheisler/criterion.rs/issues/193 --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 419ea54f..7720db13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,4 +36,6 @@ strip = "symbols" [[bench]] name = "benchmark_crackers" harness = false + +[lib] bench = false \ No newline at end of file From 944b04869be68e7087c1375e2bd42331faae0ff3 Mon Sep 17 00:00:00 2001 From: bee Date: Sun, 24 Jul 2022 20:33:56 +0100 Subject: [PATCH 08/17] bench is false https://github.com/bheisler/criterion.rs/issues/193 --- Cargo.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7720db13..8a03ef9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ license = "MIT" [lib] name = "ares" path = "src/lib.rs" +bench = false [[bin]] name = "ares" @@ -35,7 +36,4 @@ strip = "symbols" [[bench]] name = "benchmark_crackers" -harness = false - -[lib] -bench = false \ No newline at end of file +harness = false \ No newline at end of file From ddba1fd256db958c7d74cf690b0040385ea7a2db Mon Sep 17 00:00:00 2001 From: bee Date: Mon, 25 Jul 2022 07:24:58 +0100 Subject: [PATCH 09/17] bench is false https://github.com/bheisler/criterion.rs/issues/193 --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 8a03ef9e..5a3de712 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ bench = false [[bin]] name = "ares" path = "src/main.rs" +bench = false [dependencies] clap = {version = "3.0.0-beta.2", features = ["derive"]} From 1fcefa787db1e45b3add29f10dd0683670a9257c Mon Sep 17 00:00:00 2001 From: bee Date: Mon, 25 Jul 2022 07:35:56 +0100 Subject: [PATCH 10/17] Adding push to CI --- .github/workflows/pull_request.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 7221edbb..3aa70a8e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,4 +1,4 @@ -on: [pull_request] +on: [pull_request, push] name: benchmark pull requests jobs: runBenchmark: @@ -8,7 +8,9 @@ jobs: - uses: actions/checkout@master - uses: boa-dev/criterion-compare-action@v3.0.0 with: + # Optional. Features activated in the benchmark + features: "rayon" # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against branchName: ${{ github.base_ref }} # Optional. Default is `${{ github.token }}`. - token: ${{ secrets.PERSONAL_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 5bef6eb13afdf473895c9be761cfec8f49e4d90c Mon Sep 17 00:00:00 2001 From: bee Date: Mon, 25 Jul 2022 07:41:22 +0100 Subject: [PATCH 11/17] Added branch name --- .github/workflows/pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 3aa70a8e..52ee8160 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,4 +1,4 @@ -on: [pull_request, push] +on: [pull_request, push, pull_request_target] name: benchmark pull requests jobs: runBenchmark: @@ -11,6 +11,6 @@ jobs: # Optional. Features activated in the benchmark features: "rayon" # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against - branchName: ${{ github.base_ref }} + branchName: main # Optional. Default is `${{ github.token }}`. token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From cc4b0767275a60debab3cfdb6e936ed463bb54fb Mon Sep 17 00:00:00 2001 From: bee Date: Mon, 25 Jul 2022 07:49:24 +0100 Subject: [PATCH 12/17] I am fighting for my life --- .github/workflows/pull_request.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 52ee8160..0d0c5af3 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,4 +1,4 @@ -on: [pull_request, push, pull_request_target] +on: [pull_request, pull_request_target] name: benchmark pull requests jobs: runBenchmark: @@ -6,6 +6,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + - uses: boa-dev/criterion-compare-action@v3.0.0 with: # Optional. Features activated in the benchmark From 5f46f8943ea37b2a0681d815ca2992b65ee70e79 Mon Sep 17 00:00:00 2001 From: bee Date: Mon, 25 Jul 2022 07:56:13 +0100 Subject: [PATCH 13/17] I am fighting for my life --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 0d0c5af3..2e8ab3fe 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -14,6 +14,6 @@ jobs: # Optional. Features activated in the benchmark features: "rayon" # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against - branchName: main + branchName: ${{ github.base_ref }} # Optional. Default is `${{ github.token }}`. token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From cd33a141d6786a9951d56a0f3a041c0a7a7dc57e Mon Sep 17 00:00:00 2001 From: swanandx <73115739+swanandx@users.noreply.github.com> Date: Mon, 25 Jul 2022 12:59:05 +0530 Subject: [PATCH 14/17] swan joins the fight --- .github/workflows/pull_request.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2e8ab3fe..c3a53cdd 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -5,14 +5,12 @@ jobs: name: run benchmark runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - uses: boa-dev/criterion-compare-action@v3.0.0 with: - # Optional. Features activated in the benchmark - features: "rayon" # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against branchName: ${{ github.base_ref }} # Optional. Default is `${{ github.token }}`. From a200461242d93740981ab68837042d104cd31501 Mon Sep 17 00:00:00 2001 From: swanandx <73115739+swanandx@users.noreply.github.com> Date: Mon, 25 Jul 2022 13:25:32 +0530 Subject: [PATCH 15/17] removed tokens --- .github/workflows/pull_request.yml | 9 ++------- Cargo.toml | 2 ++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c3a53cdd..d7d8f2a2 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,12 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - uses: boa-dev/criterion-compare-action@v3.0.0 + - uses: boa-dev/criterion-compare-action@v3.2.2 with: # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against - branchName: ${{ github.base_ref }} - # Optional. Default is `${{ github.token }}`. - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + branchName: ${{ github.base_ref }} \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 5a3de712..cbfd7c36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,8 @@ lemmeknow = { version = "0.5", default-features = false } include_dir = "0.7.2" once_cell = "1.13.0" text_io = "0.1.10" + +[dev-dependencies] criterion = "0.3.6" [profile.release] From 2c751be5df9a1cafe78d366e2ab4476f714d330e Mon Sep 17 00:00:00 2001 From: swanandx <73115739+swanandx@users.noreply.github.com> Date: Mon, 25 Jul 2022 13:33:06 +0530 Subject: [PATCH 16/17] renamed tokens --- .github/workflows/pull_request.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d7d8f2a2..2e66a409 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -6,7 +6,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + token: ${{ secrets.PERSONAL_TOKEN }} + - uses: boa-dev/criterion-compare-action@v3.2.2 with: # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against - branchName: ${{ github.base_ref }} \ No newline at end of file + branchName: ${{ github.base_ref }} + # Optional. Default is `${{ github.token }}`. + token: ${{ secrets.PERSONAL_TOKEN }} \ No newline at end of file From 2e6b7ad4d946544eb40377a234472b930c7b92ee Mon Sep 17 00:00:00 2001 From: Bee Date: Mon, 25 Jul 2022 09:38:11 +0100 Subject: [PATCH 17/17] Delete pull_request.yml --- .github/workflows/pull_request.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index 2e66a409..00000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,17 +0,0 @@ -on: [pull_request, pull_request_target] -name: benchmark pull requests -jobs: - runBenchmark: - name: run benchmark - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.PERSONAL_TOKEN }} - - - uses: boa-dev/criterion-compare-action@v3.2.2 - with: - # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against - branchName: ${{ github.base_ref }} - # Optional. Default is `${{ github.token }}`. - token: ${{ secrets.PERSONAL_TOKEN }} \ No newline at end of file