Add "accel-*" features to arti-client and arti.

These need to be optional: they improve performance by shifting to
asm implementations, which may not be everybody's idea of good practice.

These are not 'pure' features, since they select one implementation
but disable another.  Therefore they don't go in `full`.

Closes #441.
This commit is contained in:
Nick Mathewson 2022-06-13 10:20:06 -04:00
parent 3673409735
commit 10b38a7d7c
5 changed files with 47 additions and 2 deletions

1
Cargo.lock generated
View File

@ -166,6 +166,7 @@ dependencies = [
"tor-dirmgr", "tor-dirmgr",
"tor-error", "tor-error",
"tor-guardmgr", "tor-guardmgr",
"tor-llcrypto",
"tor-netdoc", "tor-netdoc",
"tor-persist", "tor-persist",
"tor-proto", "tor-proto",

View File

@ -18,7 +18,16 @@ default = ["tokio", "native-tls"]
# * Features that are testing-only # * Features that are testing-only
# * Features which are select a particular implementation or build flag and # * Features which are select a particular implementation or build flag and
# which therefore are not strictly additive. # which therefore are not strictly additive.
full = ["tokio", "async-std", "native-tls", "rustls", "tor-rtcompat/full", "tor-proto/full", "tor-netdoc/full", "tor-dirmgr/full"] full = [
"tokio",
"async-std",
"native-tls",
"rustls",
"tor-rtcompat/full",
"tor-proto/full",
"tor-netdoc/full",
"tor-dirmgr/full",
]
async-std = ["tor-rtcompat/async-std"] async-std = ["tor-rtcompat/async-std"]
tokio = ["tor-rtcompat/tokio", "tor-proto/tokio"] tokio = ["tor-rtcompat/tokio", "tor-proto/tokio"]
@ -29,11 +38,24 @@ static = ["static-sqlite", "static-native-tls"]
static-sqlite = ["tor-dirmgr/static"] static-sqlite = ["tor-dirmgr/static"]
static-native-tls = ["tor-rtcompat/static", "native-tls"] static-native-tls = ["tor-rtcompat/static", "native-tls"]
accel-sha1-asm = ["tor-llcrypto/with-sha1-asm"]
accel-openssl = ["tor-llcrypto/with-openssl"]
# Enable experimental APIs that are not yet officially supported. # Enable experimental APIs that are not yet officially supported.
# #
# These APIs are not covered by semantic versioning. Using this # These APIs are not covered by semantic versioning. Using this
# feature voids your "semver warrantee". # feature voids your "semver warrantee".
experimental = ["dirfilter", "experimental-api", "error_detail", "tor-proto/experimental", "tor-cell/experimental", "tor-checkable/experimental", "tor-netdoc/experimental", "tor-dirmgr/experimental", "tor-circmgr/experimental"] experimental = [
"dirfilter",
"experimental-api",
"error_detail",
"tor-proto/experimental",
"tor-cell/experimental",
"tor-checkable/experimental",
"tor-netdoc/experimental",
"tor-dirmgr/experimental",
"tor-circmgr/experimental",
]
experimental-api = [] experimental-api = []
dirfilter = ["tor-dirmgr/dirfilter"] dirfilter = ["tor-dirmgr/dirfilter"]
error_detail = [] error_detail = []
@ -60,6 +82,7 @@ tor-config = { path = "../tor-config", version = "0.4.0" }
tor-dirmgr = { path = "../tor-dirmgr", version = "0.4.0" } tor-dirmgr = { path = "../tor-dirmgr", version = "0.4.0" }
tor-error = { path = "../tor-error", version = "0.3.1" } tor-error = { path = "../tor-error", version = "0.3.1" }
tor-guardmgr = { path = "../tor-guardmgr", version = "0.3.1" } tor-guardmgr = { path = "../tor-guardmgr", version = "0.3.1" }
tor-llcrypto = { path = "../tor-llcrypto", version = "0.3.1" }
tor-netdoc = { path = "../tor-netdoc", version = "0.4.0" } tor-netdoc = { path = "../tor-netdoc", version = "0.4.0" }
tor-persist = { path = "../tor-persist", version = "0.4.0" } tor-persist = { path = "../tor-persist", version = "0.4.0" }
tor-proto = { path = "../tor-proto", version = "0.3.1" } tor-proto = { path = "../tor-proto", version = "0.3.1" }

View File

@ -195,6 +195,15 @@
//! * `static-native-tls` -- link with a static version of `native-tls`. Enables //! * `static-native-tls` -- link with a static version of `native-tls`. Enables
//! `native-tls`. //! `native-tls`.
//! //!
//! ## Cryptographic acceleration features
//!
//! Libraries should not enable these by default, since they replace one
//! implementation with another.
//!
//! * `accel-sha1-asm` -- Accelerate cryptography by using an assembly
//! implementation of SHA1, if one is available.
//! * `accel-openssl` -- Accelerate cryptography by using openssl as a backend.
//!
//! ## Experimental and unstable features //! ## Experimental and unstable features
//! //!
//! Note that the APIs enabled by these features are NOT covered by semantic //! Note that the APIs enabled by these features are NOT covered by semantic

View File

@ -25,6 +25,9 @@ static-sqlite = ["arti-client/static-sqlite"]
static-native-tls = ["arti-client/static-native-tls", "native-tls"] static-native-tls = ["arti-client/static-native-tls", "native-tls"]
journald = ["tracing-journald"] journald = ["tracing-journald"]
accel-sha1-asm = ["arti-client/accel-sha1-asm"]
accel-openssl = ["arti-client/accel-openssl"]
# This feature flag enables experimental features that are not supported. Turning it on may # This feature flag enables experimental features that are not supported. Turning it on may
# void your API. # void your API.
experimental = ["arti-client/experimental"] experimental = ["arti-client/experimental"]

View File

@ -72,6 +72,15 @@
//! * `static-native-tls` -- Link with a static version of `native-tls`. Enables //! * `static-native-tls` -- Link with a static version of `native-tls`. Enables
//! `native-tls`. //! `native-tls`.
//! //!
//! ## Cryptographic acceleration features
//!
//! Libraries should not enable these by default, since they replace one
//! implementation with another.
//!
//! * `accel-sha1-asm` -- Accelerate cryptography by using an assembly
//! implementation of SHA1, if one is available.
//! * `accel-openssl` -- Accelerate cryptography by using openssl as a backend.
//!
//! ## Experimental features //! ## Experimental features
//! //!
//! Note that the APIs enabled by these features are NOT covered by semantic //! Note that the APIs enabled by these features are NOT covered by semantic