Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable fast feature of ed25519-dalek #190

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,34 @@ license = "AGPL-3.0-only"
repository = "https://github.com/IronCoreLabs/recrypt-rs"
documentation = "https://docs.rs/recrypt"
categories = ["cryptography", "algorithms"]
keywords = ["cryptography", "proxy-re-encryption", "PRE", "ECC", "transform-encryption"]
keywords = [
"cryptography",
"proxy-re-encryption",
"PRE",
"ECC",
"transform-encryption",
]
description = "A pure-Rust implementation of Transform Encryption, a Proxy Re-encryption scheme"
edition = "2021"
rust-version = "1.70.0"

[target.'cfg(all(unix, not(target_arch = "wasm32")))'.dependencies]
libc = {version = "0.2"}
libc = { version = "0.2" }

[target.'cfg(all(windows, not(target_arch = "wasm32")))'.dependencies]
winapi = {version = "0.3", features = ["memoryapi", "sysinfoapi"]}
winapi = { version = "0.3", features = ["memoryapi", "sysinfoapi"] }

[dependencies]
cfg-if = "1"
clear_on_drop = "0.2"
derivative = "2.1"
# Disable all features for ed25519 and enable the proper ones down in the [features] section below
ed25519-dalek = {version = "2.1.1", default-features = false, features = ["std", "rand_core"]}
ed25519-dalek = { version = "2.1.1", default-features = false, features = [
"std",
"rand_core",
"fast",
] }
# Explicit dependency so we can pass the wasm-bindgen flag to it
getrandom = {version = "0.2", optional = true}
getrandom = { version = "0.2", optional = true }
gridiron = "0.10"
hex = "0.4"
lazy_static = "1.4"
Expand Down
10 changes: 5 additions & 5 deletions benches/api_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use recrypt::api::CryptoOps;
use recrypt::api::Ed25519Ops;
use recrypt::api::KeyGenOps;
use recrypt::api::Recrypt;
use recrypt::api_480::CryptoOps as CryptoOps480;
use recrypt::api_480::Ed25519Ops as Ed25519Ops480;
use recrypt::api_480::KeyGenOps as KeyGenOps480;
use recrypt::api_480::Recrypt480;
// use recrypt::api_480::CryptoOps as CryptoOps480;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really want all of these commented out as it makes it less clear how to run the 480 benches. Did you comment them out for a specific reason?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to avoid the dead code analysis on the recrypt_bench! line below. I could add it back in if you prefer

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it a different way

// use recrypt::api_480::Ed25519Ops as Ed25519Ops480;
// use recrypt::api_480::KeyGenOps as KeyGenOps480;
// use recrypt::api_480::Recrypt480;
use std::cell::RefCell;

macro_rules! recrypt_bench {
Expand Down Expand Up @@ -213,7 +213,7 @@ macro_rules! recrypt_bench {
};
}

recrypt_bench! {api = Recrypt480; suite_desc = criterion_benchmark_fp480; bits = "480"}
// recrypt_bench! {api = Recrypt480; suite_desc = criterion_benchmark_fp480; bits = "480"}
recrypt_bench! {api = Recrypt; suite_desc = criterion_benchmark_fp256; bits = "256"}

criterion_group! {
Expand Down
Loading