From 179f35e0ba9c21d944e19dcc530bbb0f632c26e5 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Tue, 11 Jun 2019 20:32:54 +0000 Subject: [PATCH] Move libsecp USE_ENDOMORPHISM option behind non-default feature flag --- .travis.yml | 4 ++-- Cargo.toml | 3 ++- build.rs | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2f9a119..5554a38 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,11 +24,11 @@ script: - cargo build --verbose --features=rand - cargo test --verbose --features=rand - cargo test --verbose --features="rand serde" - - cargo test --verbose --features="rand serde recovery" + - cargo test --verbose --features="rand serde recovery endomorphism" - cargo build --verbose --no-default-features - cargo build --verbose --no-default-features --features="serde" - cargo build --verbose --no-default-features --features="rand" - - cargo build --verbose --no-default-features --features="rand serde recovery" + - cargo build --verbose --no-default-features --features="rand serde recovery endomorphism" - cargo build --verbose --no-default-features --features="fuzztarget recovery" - cargo build --verbose - cargo test --verbose diff --git a/Cargo.toml b/Cargo.toml index 6325e31..5f2bc5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ build = "build.rs" # Should make docs.rs show all functions, even those behind non-default features [package.metadata.docs.rs] -features = [ "rand", "serde", "recovery" ] +features = [ "rand", "serde", "recovery", "endomorphism" ] all-features = true [build-dependencies] @@ -31,6 +31,7 @@ default = ["std"] fuzztarget = [] std = [] recovery = [] +endomorphism = [] [dev-dependencies] rand = "0.6" diff --git a/build.rs b/build.rs index d104124..664af17 100644 --- a/build.rs +++ b/build.rs @@ -52,9 +52,10 @@ fn main() { .define("USE_NUM_NONE", Some("1")) .define("USE_FIELD_INV_BUILTIN", Some("1")) .define("USE_SCALAR_INV_BUILTIN", Some("1")) - .define("USE_ENDOMORPHISM", Some("1")) .define("ENABLE_MODULE_ECDH", Some("1")); + #[cfg(feature = "endomorphism")] + base_config.define("USE_ENDOMORPHISM", Some("1")); #[cfg(feature = "recovery")] base_config.define("ENABLE_MODULE_RECOVERY", Some("1"));