Skip to content

Commit 3a19153

Browse files
authored
p521: arithmetic feature (#953)
Now that #946, #950, and #951 have landed it seems prudent to add a real `arithmetic` feature. This adds a feature similar to the other crates in this repo which exposes the following types which provide a curve arithmetic implementation: - `AffinePoint` - `ProjectivePoint` - `Scalar` The `wip-arithmetic-do-not-use` feature is now removed as well. While technically SemVer breaking, it wasn't supposed to be used in the first place! Closes #947
1 parent 45540cf commit 3a19153

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

p521/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ hex-literal = "0.4"
2929
primeorder = { version = "0.13.3", features = ["dev"], path = "../primeorder" }
3030

3131
[features]
32-
default = ["pem", "std"]
32+
default = ["arithmetic", "pem", "std"]
3333
alloc = ["elliptic-curve/alloc"]
3434
std = ["alloc", "elliptic-curve/std"]
3535

36+
arithmetic = ["dep:primeorder"]
3637
jwk = ["elliptic-curve/jwk"]
3738
pem = ["elliptic-curve/pem", "pkcs8"]
3839
pkcs8 = ["elliptic-curve/pkcs8"]
3940
test-vectors = ["dep:hex-literal"]
40-
wip-arithmetic-do-not-use = ["dep:primeorder"]
4141
voprf = ["elliptic-curve/voprf", "dep:sha2"]
4242

4343
[package.metadata.docs.rs]

p521/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515
unused_qualifications
1616
)]
1717

18-
#[cfg(feature = "wip-arithmetic-do-not-use")]
18+
#[cfg(feature = "arithmetic")]
1919
pub mod arithmetic;
2020

2121
#[cfg(any(feature = "test-vectors", test))]
2222
pub mod test_vectors;
2323

24+
#[cfg(feature = "arithmetic")]
25+
pub use arithmetic::{scalar::Scalar, AffinePoint, ProjectivePoint};
26+
2427
pub use elliptic_curve::{self, bigint::U576};
2528

2629
#[cfg(feature = "pkcs8")]

p521/tests/projective.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Projective arithmetic tests.
22
3-
#![cfg(all(feature = "wip-arithmetic-do-not-use", feature = "test-vectors"))]
3+
#![cfg(all(feature = "arithmetic", feature = "test-vectors"))]
44

55
use elliptic_curve::{
66
group::ff::PrimeField,

0 commit comments

Comments
 (0)