1
0
Fork 0
mirror of https://github.com/nymtech/sphinx.git synced 2025-12-03 16:23:55 -05:00
No description
Find a file
Jędrzej Stuczyński 9955d64a30
Feature/seeded payload keys (#102)
* introduce payload key seeds

* remove clone of initial secret when deriving key material

* convenience methods

* typo
2025-04-09 09:31:31 +01:00
.github/workflows removed deprecated CI job for test coverage 2025-02-19 13:39:06 +00:00
benches Feature/seeded payload keys (#102) 2025-04-09 09:31:31 +01:00
scripts Adding shebang 2020-04-08 17:34:05 +01:00
src Feature/seeded payload keys (#102) 2025-04-09 09:31:31 +01:00
tests feat: ExpandedSharedSecret /w ReplyTag (with legacy compat) (#101) 2025-03-28 09:44:55 +00:00
.gitignore Ignoring bench temp files 2022-06-01 17:13:22 +01:00
Cargo.toml Feature/seeded payload keys (#102) 2025-04-09 09:31:31 +01:00
clippy.toml Feature/seeded payload keys (#102) 2025-04-09 09:31:31 +01:00
LICENSE Initial commit 2019-11-01 10:24:41 +00:00
README.md Feature/seeded payload keys (#102) 2025-04-09 09:31:31 +01:00

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

v0.3.2

added version method to allow constructing SURBs with legacy headers

v0.4.0

removed processing and creation of packets with undefined operations

v0.5.0

  • temporarily restored processing and creation of packets with undefined operations as additional breaking changes had to be added to v0.3.2 release
  • removed RoutingKeys in favour of ExpandedSharedSecret and added ReplyTag
  • type adjustments

v0.6.0

  • new way of deriving PayloadKey that uses seed obtained from the ExpandedSharedSecret to reduce sizes of SURBs
  • API changes

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