Skip to content

Commit

Permalink
Use explicit crate features (facebook#100)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5bce3e3)
  • Loading branch information
daxpedda authored and cyyynthia committed Sep 22, 2024
1 parent 40bcbb2 commit 6c97fb7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ version = "0.5.0-pre.1"
[features]
alloc = []
danger = []
default = ["ristretto255-ciphersuite", "serde"]
ristretto255 = ["curve25519-dalek", "generic-array/more_lengths"]
ristretto255-ciphersuite = ["ristretto255", "sha2"]
serde = ["generic-array/serde", "serde_"]
default = ["ristretto255-ciphersuite", "dep:serde"]
ristretto255 = ["dep:curve25519-dalek", "generic-array/more_lengths"]
ristretto255-ciphersuite = ["ristretto255", "dep:sha2"]
serde = ["generic-array/serde", "dep:serde"]
std = ["alloc"]

[dependencies]
Expand All @@ -35,7 +35,7 @@ elliptic-curve = { version = "0.12", features = [
] }
generic-array = "0.14"
rand_core = { version = "0.6", default-features = false }
serde_ = { version = "1", package = "serde", default-features = false, features = [
serde = { version = "1", default-features = false, features = [
"derive",
], optional = true }
sha2 = { version = "0.10", default-features = false, optional = true }
Expand Down
8 changes: 4 additions & 4 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl Mode {
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(crate = "serde", bound = "")
serde(bound = "")
)]
pub struct BlindedElement<CS: CipherSuite>(
#[cfg_attr(feature = "serde", serde(with = "Element::<CS::Group>"))]
Expand All @@ -89,7 +89,7 @@ where
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(crate = "serde", bound = "")
serde(bound = "")
)]
pub struct EvaluationElement<CS: CipherSuite>(
#[cfg_attr(feature = "serde", serde(with = "Element::<CS::Group>"))]
Expand All @@ -106,7 +106,7 @@ where
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(crate = "serde", bound = "")
serde(bound = "")
)]
pub struct PreparedEvaluationElement<CS: CipherSuite>(pub(crate) EvaluationElement<CS>)
where
Expand All @@ -120,7 +120,7 @@ where
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(crate = "serde", bound = "")
serde(bound = "")
)]
pub struct Proof<CS: CipherSuite>
where
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,6 @@ extern crate alloc;
#[cfg(feature = "std")]
extern crate std;

#[cfg(feature = "serde")]
extern crate serde_ as serde;

mod ciphersuite;
mod common;
mod error;
Expand Down
4 changes: 2 additions & 2 deletions src/oprf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use crate::{CipherSuite, Error, Group, Result};
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(crate = "serde", bound = "")
serde(bound = "")
)]
pub struct OprfClient<CS: CipherSuite>
where
Expand All @@ -59,7 +59,7 @@ where
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(crate = "serde", bound = "")
serde(bound = "")
)]
pub struct OprfServer<CS: CipherSuite>
where
Expand Down
6 changes: 3 additions & 3 deletions src/poprf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use crate::{CipherSuite, Error, Group, Result};
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(crate = "serde", bound = "")
serde(bound = "")
)]
pub struct PoprfClient<CS: CipherSuite>
where
Expand All @@ -61,7 +61,7 @@ where
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(crate = "serde", bound = "")
serde(bound = "")
)]
pub struct PoprfServer<CS: CipherSuite>
where
Expand Down Expand Up @@ -541,7 +541,7 @@ pub type PoprfServerBatchEvaluatePreparedEvaluationElements<CS, I> = Map<
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(crate = "serde", bound = "")
serde(bound = "")
)]
pub struct PoprfPreparedTweak<CS: CipherSuite>(
#[cfg_attr(feature = "serde", serde(with = "Scalar::<CS::Group>"))]
Expand Down
4 changes: 2 additions & 2 deletions src/voprf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use crate::{CipherSuite, Error, Group, Result};
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(crate = "serde", bound = "")
serde(bound = "")
)]
pub struct VoprfClient<CS: CipherSuite>
where
Expand All @@ -59,7 +59,7 @@ where
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize, serde::Serialize),
serde(crate = "serde", bound = "")
serde(bound = "")
)]
pub struct VoprfServer<CS: CipherSuite>
where
Expand Down

0 comments on commit 6c97fb7

Please sign in to comment.