diff options
author | Igor Matuszewski <igor@sequoia-pgp.org> | 2020-04-04 18:10:29 +0200 |
---|---|---|
committer | Igor Matuszewski <igor@sequoia-pgp.org> | 2020-04-06 16:41:34 +0200 |
commit | 583cb3def73457d9594d518679d03fcda1464180 (patch) | |
tree | 89270ddea8c83b08c15e8496477bc25d031978e2 /openpgp | |
parent | 488985f8f2e119c553f2d03d8bd87d49f45d8227 (diff) |
openpgp: Introduce (mandatory, for now) crypto-nettle feature flag
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/Cargo.toml | 6 | ||||
-rw-r--r-- | openpgp/src/lib.rs | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/openpgp/Cargo.toml b/openpgp/Cargo.toml index 375908f4..104cb6c5 100644 --- a/openpgp/Cargo.toml +++ b/openpgp/Cargo.toml @@ -32,7 +32,7 @@ lalrpop-util = "0.17" lazy_static = "1.3" libc = "0.2" memsec = "0.5.6" -nettle = "7" +nettle = { version = "7", optional = true } quickcheck = { version = "0.9", default-features = false } rand = { version = "0.7", default-features = false } regex = "1" @@ -46,7 +46,9 @@ lalrpop = "0.17" rpassword = "=4.0.3" [features] -default = ["compression"] +default = ["compression", "crypto-nettle"] +# TODO(#333): Allow for/implement more backends +crypto-nettle = ["nettle"] # The compression algorithms. compression = ["compression-deflate", "compression-bzip2"] diff --git a/openpgp/src/lib.rs b/openpgp/src/lib.rs index f41eeba6..7d9a7670 100644 --- a/openpgp/src/lib.rs +++ b/openpgp/src/lib.rs @@ -54,6 +54,9 @@ extern crate lazy_static; #[macro_use] mod macros; +#[cfg(not(feature = "crypto-nettle"))] +compile_error!("Sequoia currently requires the Nettle cryptographic library for now"); + // On debug builds, Vec<u8>::truncate is very, very slow. For // instance, running the decrypt_test_stream test takes 51 seconds on // my (Neal's) computer using Vec<u8>::truncate and <0.1 seconds using |