Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/elliptic-curve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ jobs:
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features sec1
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features serde
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features voprf
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features alloc,arithmetic,pkcs8
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features alloc,serde
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features arithmetic,serde
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features pkcs8,sec1
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features pem,pkcs8,sec1
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features alloc,digest,ecdh,hazmat,hash2curve,jwk,pem,pkcs8,sec1,serde,voprf

# TODO: use the reusable workflow after this crate is re-added to the
Expand Down
4 changes: 3 additions & 1 deletion elliptic-curve/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ default = ["arithmetic"]
alloc = ["base16ct/alloc", "der/alloc", "ff?/alloc", "group?/alloc", "sec1?/alloc", "zeroize/alloc"]
std = ["alloc", "rand_core/std", "sec1?/std"]

arithmetic = ["ff", "group"]
arithmetic = ["group"]
bits = ["arithmetic", "ff/bits"]
dev = ["arithmetic", "hex-literal", "pem", "pkcs8"]
hash2curve = ["arithmetic", "digest"]
ecdh = ["arithmetic", "digest", "hkdf"]
group = ["dep:group", "ff"]
hazmat = []
jwk = ["alloc", "base64ct/alloc", "serde", "serde_json", "zeroize/alloc"]
pkcs8 = ["dep:pkcs8", "sec1"]
pem = ["alloc", "arithmetic", "der/pem", "pem-rfc7468/alloc", "pkcs8", "sec1/pem"]
serde = ["alloc", "pkcs8", "sec1/serde", "serdect"]
voprf = ["digest"]
Expand Down
2 changes: 1 addition & 1 deletion elliptic-curve/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use hex_literal::hex;
use pkcs8::AssociatedOid;

#[cfg(feature = "bits")]
use crate::group::ff::PrimeFieldBits;
use ff::PrimeFieldBits;

#[cfg(feature = "jwk")]
use crate::JwkParameters;
Expand Down
2 changes: 1 addition & 1 deletion elliptic-curve/src/scalar/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use zeroize::DefaultIsZeroes;
#[cfg(feature = "arithmetic")]
use {
super::{Scalar, ScalarArithmetic},
group::ff::PrimeField,
ff::PrimeField,
};

#[cfg(feature = "serde")]
Expand Down
8 changes: 2 additions & 6 deletions elliptic-curve/src/secret_key/pkcs8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ use der::Decode;
use sec1::EcPrivateKey;

// Imports for the `EncodePrivateKey` impl
// TODO(tarcieri): use weak activation of `pkcs8/alloc` for gating `EncodePrivateKey` impl
#[cfg(all(feature = "arithmetic", feature = "pem"))]
#[cfg(all(feature = "alloc", feature = "arithmetic"))]
use {
crate::{
sec1::{FromEncodedPoint, ToEncodedPoint},
Expand Down Expand Up @@ -51,10 +50,7 @@ where
{
}

// TODO(tarcieri): use weak activation of `pkcs8/alloc` for this when possible
// It doesn't strictly depend on `pkcs8/pem` but we can't easily activate `pkcs8/alloc`
// without adding a separate crate feature just for this functionality.
#[cfg(all(feature = "arithmetic", feature = "pem"))]
#[cfg(all(feature = "alloc", feature = "arithmetic"))]
impl<C> EncodePrivateKey for SecretKey<C>
where
C: Curve + AssociatedOid + ProjectiveArithmetic,
Expand Down