3 unstable releases

0.2.0 May 20, 2024
0.1.1 May 21, 2024
0.1.0 Feb 22, 2023

#182 in Cryptography

Download history 1348/week @ 2024-06-17 970/week @ 2024-06-24 1149/week @ 2024-07-01 763/week @ 2024-07-08 857/week @ 2024-07-15 1594/week @ 2024-07-22 1079/week @ 2024-07-29 960/week @ 2024-08-05 795/week @ 2024-08-12 1309/week @ 2024-08-19 1512/week @ 2024-08-26 2092/week @ 2024-09-02 1103/week @ 2024-09-09 1029/week @ 2024-09-16 1567/week @ 2024-09-23 753/week @ 2024-09-30

4,604 downloads per month
Used in 3 crates (2 directly)

Apache-2.0

155KB
3K SLoC

Sphinx

A Sphinx packet implementation in Rust.

License Build Status codecov

Prerequisites

Testing

cargo test will run the unit and integration tests.

Code coverage reporting

If you want to find out how you're doing in terms of code coverage, install docker and then run the code coverage shell script at ./scripts/coverage_report.sh. Docker will download all the dependencies (get a coffee!), and output an HTML code coverage report at coverage/tarpaulin-report.html. Open the generated file in your browser to check coverage.

Unit + integration test coverage is currently well above 90%, please ensure that any pull requests maintain good test coverage.

Benchmarks

To run benchmarks, use:

cargo bench

Rust benchmarks run the operation multiple times to give a consistent output and report back in the number of nanoseconds (billionths of a second) per iteration. 1000000000 / result gives you the number of operations per second.

For later reference, on Dave's i7 Dell XPS-13 (2018) laptop (our test reference machine :)) output is as follows.

test tests::bench_new     ... bench:     386.348 us/iter
test tests::bench_process ... bench:     157.322 us/iter
  • 1000000 / 386.348 = ~2588 packet creations per second
  • 1000000 / 157.322 = ~6356 packet unwrappings per second

Dependencies

~4–5.5MB
~105K SLoC