From fed89faeb84361d01d773ddec324736903c60d60 Mon Sep 17 00:00:00 2001 From: Craig Colegrove Date: Thu, 5 Dec 2024 13:15:52 -0800 Subject: [PATCH 1/3] Enable feature of ed25519-dalek --- Cargo.toml | 21 +++++++++++++++------ benches/api_benchmark.rs | 10 +++++----- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 00766cf..13bae8b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/benches/api_benchmark.rs b/benches/api_benchmark.rs index a7395af..492a10e 100644 --- a/benches/api_benchmark.rs +++ b/benches/api_benchmark.rs @@ -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; +// 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 { @@ -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! { From a2a035426abf33f95d2a8d277741010cf0f59fb9 Mon Sep 17 00:00:00 2001 From: Craig Colegrove Date: Thu, 5 Dec 2024 13:19:16 -0800 Subject: [PATCH 2/3] Changelog and version bump --- CHANGELOG.md | 7 +++++++ Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d01ff52..c063e96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.14.1 (2024-12-05) + +- [[#190](https://github.com/IronCoreLabs/recrypt-rs/pull/190)] + - Fix performance regression with generating ed25519 keypairs introduced in 0.14.0. + ## 0.14.0 (2024-12-03) - [[#184](https://github.com/IronCoreLabs/recrypt-rs/pull/188)] @@ -15,9 +20,11 @@ ## 0.13.1 (2021-11-29) ### Public API changes + None ### Notable internal changes + [[#163]](https://github.com/IronCoreLabs/recrypt-rs/pull/163) Fix compilation error for certain combinations of transitive dependencies related to ed25519-dalek-fiat ## 0.13.0 (yanked) diff --git a/Cargo.toml b/Cargo.toml index 13bae8b..a5855ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "recrypt" -version = "0.14.0" +version = "0.14.1" authors = ["IronCore Labs "] readme = "README.md" license = "AGPL-3.0-only" From 2f37abd6faeaf00d90fb401cab4615a79f43c154 Mon Sep 17 00:00:00 2001 From: Craig Colegrove Date: Thu, 5 Dec 2024 13:27:49 -0800 Subject: [PATCH 3/3] Different way to avoid dead code warning --- benches/api_benchmark.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/benches/api_benchmark.rs b/benches/api_benchmark.rs index 492a10e..acac47a 100644 --- a/benches/api_benchmark.rs +++ b/benches/api_benchmark.rs @@ -7,14 +7,15 @@ 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; +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 { (api = $api:ident; suite_desc = $suite_desc:ident; bits = $bits:tt) => { + #[allow(dead_code)] fn $suite_desc(c: &mut Criterion) { c.bench_function(concat!($bits, "-bit generate key pair"), |b| { let api = $api::new(); @@ -213,7 +214,8 @@ macro_rules! recrypt_bench { }; } -// recrypt_bench! {api = Recrypt480; suite_desc = criterion_benchmark_fp480; bits = "480"} +// Note: this benchmark is currently unused. Uncomment `criterion_benchmark_fp480` below to run it as well. +recrypt_bench! {api = Recrypt480; suite_desc = criterion_benchmark_fp480; bits = "480"} recrypt_bench! {api = Recrypt; suite_desc = criterion_benchmark_fp256; bits = "256"} criterion_group! {