| Crates.io | sphinx-packet |
| lib.rs | sphinx-packet |
| version | 0.6.0 |
| created_at | 2023-02-22 09:52:01.130597+00 |
| updated_at | 2025-04-09 08:33:01.232483+00 |
| description | A Sphinx packet implementation in Rust |
| homepage | |
| repository | https://github.com/nymtech/sphinx |
| max_upload_size | |
| id | 791682 |
| size | 242,608 |
A Sphinx packet implementation in Rust.
cargo test will run the unit and integration tests.
Whilst this crate hasn't been strictly following the semver versioning conventions, the following changes have been made:
initial release
updates crypto dependencies, including dalek libraries
fixes uses of undefined scalar multiplications and transitions to using pure x25519 instead
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
added additional public methods on the Version
added version method to allow constructing SURBs with legacy headers
removed processing and creation of packets with undefined operations
RoutingKeys in favour of ExpandedSharedSecret and added ReplyTagPayloadKey that uses seed obtained from the ExpandedSharedSecret to reduce sizes of SURBsTo 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 second1000000 / 157.322 = ~6356 packet unwrappings per second