Skip to content

Commit

Permalink
X25519 benchmarks (#219)
Browse files Browse the repository at this point in the history
* add dalek and ristretto benches
* add benchmarks for lib25519 on linux
* lib25519 crate

---------

Co-authored-by: Karthikeyan Bhargavan <[email protected]>
  • Loading branch information
franziskuskiefer and karthikbhargavan authored Apr 4, 2024
1 parent 9f18bc4 commit c33e5df
Show file tree
Hide file tree
Showing 10 changed files with 1,604 additions and 25 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"sys/libjade",
"sys/platform",
"sys/pqclean",
"sys/lib25519",
"benchmarks",
"fuzz",
]
Expand Down
9 changes: 9 additions & 0 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ sha3 = "0.10"
p256 = { version = "0.13", features = ["ecdh"] }
# Benchmarking "Ring"
ring = "0.17"
# Benchmarking "Dalek X25519"
x25519-dalek = "2.0.1"
# Benchmarking "Dalek Ristretto"
curve25519-dalek = "4.1.2"

# We always link this on linux, even if it may not be built.
# We check that in the build instead.
[target.'cfg(all(target_arch = "x86_64", target_os = "linux", crypto_lib25519))'.dev-dependencies]
lib25519 = { path = "../sys/lib25519" }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = "0.5"
Expand Down
14 changes: 14 additions & 0 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Libcrux Benchmarks

This crate is used to benchmark libcrux and compare it to 3rd party implementations.

## lib25519
Comparing with lib25519 only works on Linux.
To enable it first build the sys crate

```bash
cd ../sys/lib25519
./build-native.sh

RUSTFLAGS="--cfg crypto_lib25519" cargo criterion --bench x25519
```
Loading

0 comments on commit c33e5df

Please sign in to comment.