Skip to content

Commit 05ea002

Browse files
authored
k256: remove field-montgomery feature (#404)
Removes the original legacy field implementation inherited (in modified form) from the `p256` crate. At this point the new field implementations seem fairly solid, so there's little reason to keep it around besides additional complexity.
1 parent 5fc407c commit 05ea002

File tree

7 files changed

+37
-485
lines changed

7 files changed

+37
-485
lines changed

.github/workflows/k256.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ jobs:
9696
- run: cargo check --target ${{ matrix.target }} --all-features
9797
- run: cargo test --release --target ${{ matrix.target }} --no-default-features
9898
- run: cargo test --release --target ${{ matrix.target }}
99-
- run: cargo test --release --target ${{ matrix.target }} --features field-montgomery
10099
- run: cargo test --release --target ${{ matrix.target }} --all-features
101100

102101
# TODO(tarcieri): re-enable when new `elliptic-curve` and `ecdsa` crates are released

k256/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ digest = ["ecdsa-core/digest", "ecdsa-core/hazmat"]
4444
ecdh = ["arithmetic", "elliptic-curve/ecdh", "zeroize"]
4545
ecdsa = ["arithmetic", "digest", "ecdsa-core/sign", "ecdsa-core/verify", "zeroize"]
4646
expose-field = ["arithmetic"]
47-
field-montgomery = []
4847
jwk = ["elliptic-curve/jwk"]
4948
keccak256 = ["digest", "sha3"]
5049
pem = ["elliptic-curve/pem", "pkcs8"]

k256/src/arithmetic/field.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
use cfg_if::cfg_if;
44

55
cfg_if! {
6-
if #[cfg(feature = "field-montgomery")] {
7-
mod field_montgomery;
8-
} else if #[cfg(target_pointer_width = "32")] {
6+
if #[cfg(target_pointer_width = "32")] {
97
mod field_10x26;
108
} else if #[cfg(target_pointer_width = "64")] {
119
mod field_5x52;
@@ -15,14 +13,12 @@ cfg_if! {
1513
}
1614

1715
cfg_if! {
18-
if #[cfg(all(debug_assertions, not(feature = "field-montgomery")))] {
16+
if #[cfg(debug_assertions)] {
1917
mod field_impl;
2018
use field_impl::FieldElementImpl;
2119
} else {
2220
cfg_if! {
23-
if #[cfg(feature = "field-montgomery")] {
24-
use field_montgomery::FieldElementMontgomery as FieldElementImpl;
25-
} else if #[cfg(target_pointer_width = "32")] {
21+
if #[cfg(target_pointer_width = "32")] {
2622
use field_10x26::FieldElement10x26 as FieldElementImpl;
2723
} else if #[cfg(target_pointer_width = "64")] {
2824
use field_5x52::FieldElement5x52 as FieldElementImpl;

0 commit comments

Comments
 (0)