5 unstable releases

new 0.3.1 Feb 20, 2025
0.3.0 Feb 20, 2025
0.2.0 May 20, 2024
0.1.1 May 21, 2024
0.1.0 Feb 22, 2023

#180 in Cryptography

Download history 1348/week @ 2024-10-30 1209/week @ 2024-11-06 749/week @ 2024-11-13 769/week @ 2024-11-20 937/week @ 2024-11-27 1156/week @ 2024-12-04 1101/week @ 2024-12-11 810/week @ 2024-12-18 164/week @ 2024-12-25 365/week @ 2025-01-01 826/week @ 2025-01-08 890/week @ 2025-01-15 1028/week @ 2025-01-22 733/week @ 2025-01-29 943/week @ 2025-02-05 1118/week @ 2025-02-12

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

Apache-2.0

170KB
3.5K SLoC

Sphinx

A Sphinx packet implementation in Rust.

License Build Status

Prerequisites

Testing

cargo test will run the unit and integration tests.

Versioning

Whilst this crate hasn't been strictly following the semver versioning conventions, the following changes have been made:

v0.1.0

initial release

v0.1.1

updates crypto dependencies, including dalek libraries

v0.2.0

fixes uses of undefined scalar multiplications and transitions to using pure x25519 instead

v0.3.0

allows using the library with either the v0.2.0 or v0.1.1 crypto (for backwards compatibility reasons). it also changes the public API to expose version information which has further been reinterpreted to no longer map to the semver version of this library

v0.3.1

added additional public methods on the Version

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
~108K SLoC