Commit Graph

19 Commits

Author SHA1 Message Date
Nick Mathewson cec6d0ce33 Run add_warnings on all files. 2023-08-04 07:45:04 -04:00
Micah Elizabeth Scott 943960e4d3 equix/bench: Update Cargo.lock
New dependency from 82eb88bd74
2023-08-02 19:29:23 -07:00
Nick Mathewson 5c607e8cf6 Merge branch 'ticket889_fuzz' into 'main'
Fuzzers for Equi-X and HashX

See merge request tpo/core/arti!1459
2023-08-02 22:12:20 +00:00
Micah Elizabeth Scott 21dfc6d58c equix/fuzz: CI and doc fixes
The build found a stale private doc comment as well as an exception
that needed to be made in check_doc_features.

The check_doc_features change solidifies a decision that things marked
with cfg(fuzzing) aren't part of the documented API.
2023-08-02 14:46:46 -07:00
Micah Elizabeth Scott bf0119fbfe hashx/fuzz, equix/fuzz: use arti-corpora
Remove corpus from .gitignore and add a symlink to the corpora
submodule.
2023-08-01 19:34:04 -07:00
Micah Elizabeth Scott 0ffb2849e1 equix/fuzz: rustfmt 2023-08-01 19:34:04 -07:00
Micah Elizabeth Scott 82eb88bd74 equix/fuzz: Fixes to get nick's prototype running
There are some places we might improve this, maybe testing more data
types and shapes. This patch just makes the minimal changes necessary
to get it working: adds allocation logic to the fuzzer itself,
and adds visibility for the bucket_array::mem interface.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-08-01 19:34:04 -07:00
Nick Mathewson 89fb338fd5 WIP: Fuzzer for BucketArray. 2023-08-01 19:34:03 -07:00
Micah Elizabeth Scott 315122f159 hashx/bench, equix/bench: Enable debug symbols
Propagates this setting from the outer Cargo.toml to the new
benchmark crates, since they no longer get the setting by
being included in the main workspace.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-08-01 19:28:46 -07:00
Micah Elizabeth Scott 256e5de9e5 hashx/bench, equix/bench: check in matching Cargo.lock files
It might be useful to keep these locked down for benchmark
reproducibility. Currently the hashx and equix crates are
fully separate.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-08-01 19:28:46 -07:00
Micah Elizabeth Scott ae58ea0697 equix, hashx: Benchmark against C implementation
This is a small batch of improvements for the equix and hashx
benchmarks. The headline feature is that we are now including
the C implementations (slightly modified from tevador's, hosted
as part of c-tor) and using them in apples-to-apples comparisons.

Minor features:
- Benchmarks moved to new nested crates, preventing their
  dependencies from spilling into the main workspace build.
- Tests are now grouped
- We also test the performance of memory reuse where possible
- Code cleanup for per-runtime options

These benchmark builds will now automatically pull in the c-tor
git repo and build portions of it with a Rust wrapper. This uses
the 'cc' and 'bindgen' crates, so it requires a C compiler and
libclang on the host system.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-08-01 19:28:43 -07:00
Nick Mathewson 9ce6f0a0eb Run "fixup features" in preparation for a release. 2023-08-01 08:32:20 -04:00
Micah Elizabeth Scott 9257949b80 equix, hashx: Additional comment tweaks
More review feedback. Thanks nickm!

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 13:17:23 -07:00
Micah Elizabeth Scott fdba82100f equix, hashx: Prepare for an initial LGPL release
This replaces the 'TODO' marker from earlier commits, using tevador's
copyright and license (LGPL 3.0 only) for the hashx and equix crates.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott 4affddaa08 tor-hspow, equix, hashx: Comment tweaks
Making a few comment tweaks suggested in review feedback.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott f4939a5fd8 tor-hspow, equix, hashx: Make all error types Clone
This uses an Arc to hold std::io::Error for low-level HashX runtime
errors.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott c5976c6675 equix: Refactoring for bucket_array
This splits up bucket_array into two smaller modules, one for the hash
table behavior and one for the MaybeUninit memory management.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott 8a79021f38 Update equix, hashx, tor-hspow for new clippy defaults
Just running maint/add_warning after the rebase
2023-07-27 07:20:14 -07:00
Micah Elizabeth Scott 16c9bdf178 Reimplement Equi-X in Rust
This is a new pure Rust implementation of the Equi-X algorithm
designed by tevador for Tor's onion service proof of work puzzle v1.

Equi-X is an asymmetric puzzle algorithm based on Equihash, with
N=60, K=3, the XOR replaced with modular addition, a 16-bit index
space, and HashX as the inner hash function.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-07-27 07:20:14 -07:00