Skip to content

Commit 273830e

Browse files
authored
p384: rename arithmetic feature to broken-arithmetic-do-not-use (#513)
The arithmetic implementations as they currently exist are known to be broken, so to prevent someone from accidentally attempting to use them unknowingly, renames the feature to `broken-arithmetic-do-not-use`. Additionally removes the derived `invert` and `sqrt` methods.
1 parent 5b25e50 commit 273830e

File tree

6 files changed

+17
-1047
lines changed

6 files changed

+17
-1047
lines changed

.github/workflows/p384.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
override: true
3838
profile: minimal
3939
- run: cargo build --target ${{ matrix.target }} --release --no-default-features
40+
# TODO(tarcieri): currently 64-bit only
41+
# - run: cargo build --target ${{ matrix.target }} --release --no-default-features --features broken-arithmetic-do-not-use
4042
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features ecdsa
4143
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features jwk
4244
- run: cargo build --target ${{ matrix.target }} --release --no-default-features --features pem

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ and can be easily used for bare-metal or WebAssembly programming.
1414

1515
| Name | Curve | `arithmetic`? | Crates.io | Documentation | Build Status |
1616
|-----------|--------------------|---------------|-----------|---------------|--------------|
17-
| [`bp256`] | brainpoolP256r1/t1 | 🚫 | [![crates.io](https://img.shields.io/crates/v/bp256.svg)](https://crates.io/crates/bp256) | [![Documentation](https://docs.rs/bp256/badge.svg)](https://docs.rs/bp256) | ![build](https://github.com/RustCrypto/elliptic-curves/workflows/bp256/badge.svg?branch=master&event=push) |
18-
| [`bp384`] | brainpoolP384r1/t1 | 🚫 | [![crates.io](https://img.shields.io/crates/v/bp384.svg)](https://crates.io/crates/bp384) | [![Documentation](https://docs.rs/bp384/badge.svg)](https://docs.rs/bp384) | ![build](https://github.com/RustCrypto/elliptic-curves/workflows/bp384/badge.svg?branch=master&event=push) |
19-
| [`k256`] | [secp256k1] || [![crates.io](https://img.shields.io/crates/v/k256.svg)](https://crates.io/crates/k256) | [![Documentation](https://docs.rs/k256/badge.svg)](https://docs.rs/k256) | ![build](https://github.com/RustCrypto/elliptic-curves/workflows/k256/badge.svg?branch=master&event=push) |
20-
| [`p256`] | [NIST P-256] || [![crates.io](https://img.shields.io/crates/v/p256.svg)](https://crates.io/crates/p256) | [![Documentation](https://docs.rs/p256/badge.svg)](https://docs.rs/p256) | ![build](https://github.com/RustCrypto/elliptic-curves/workflows/p256/badge.svg?branch=master&event=push) |
21-
| [`p384`] | [NIST P-384] | 🚫 | [![crates.io](https://img.shields.io/crates/v/p384.svg)](https://crates.io/crates/p384) | [![Documentation](https://docs.rs/p384/badge.svg)](https://docs.rs/p384) | ![build](https://github.com/RustCrypto/elliptic-curves/workflows/p384/badge.svg?branch=master&event=push) |
17+
| [`bp256`] | brainpoolP256r1/t1 | 🚫 | [![crates.io](https://img.shields.io/crates/v/bp256.svg)](https://crates.io/crates/bp256) | [![Documentation](https://docs.rs/bp256/badge.svg)](https://docs.rs/bp256) | ![build](https://github.com/RustCrypto/elliptic-curves/workflows/bp256/badge.svg?branch=master&event=push) |
18+
| [`bp384`] | brainpoolP384r1/t1 | 🚫 | [![crates.io](https://img.shields.io/crates/v/bp384.svg)](https://crates.io/crates/bp384) | [![Documentation](https://docs.rs/bp384/badge.svg)](https://docs.rs/bp384) | ![build](https://github.com/RustCrypto/elliptic-curves/workflows/bp384/badge.svg?branch=master&event=push) |
19+
| [`k256`] | [secp256k1] | | [![crates.io](https://img.shields.io/crates/v/k256.svg)](https://crates.io/crates/k256) | [![Documentation](https://docs.rs/k256/badge.svg)](https://docs.rs/k256) | ![build](https://github.com/RustCrypto/elliptic-curves/workflows/k256/badge.svg?branch=master&event=push) |
20+
| [`p256`] | [NIST P-256] | | [![crates.io](https://img.shields.io/crates/v/p256.svg)](https://crates.io/crates/p256) | [![Documentation](https://docs.rs/p256/badge.svg)](https://docs.rs/p256) | ![build](https://github.com/RustCrypto/elliptic-curves/workflows/p256/badge.svg?branch=master&event=push) |
21+
| [`p384`] | [NIST P-384] | 🚧 | [![crates.io](https://img.shields.io/crates/v/p384.svg)](https://crates.io/crates/p384) | [![Documentation](https://docs.rs/p384/badge.svg)](https://docs.rs/p384) | ![build](https://github.com/RustCrypto/elliptic-curves/workflows/p384/badge.svg?branch=master&event=push) |
2222

2323
NOTE: Some crates contain field/point arithmetic implementations gated under the
2424
`arithmetic` cargo feature as noted above.

p384/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ hex-literal = "0.3"
2323

2424
[features]
2525
default = ["pkcs8", "std"]
26-
arithmetic = ["elliptic-curve/arithmetic"]
26+
broken-arithmetic-do-not-use = ["elliptic-curve/arithmetic"]
2727
jwk = ["elliptic-curve/jwk"]
2828
pem = ["elliptic-curve/pem", "pkcs8"]
2929
pkcs8 = ["elliptic-curve/pkcs8"]

p384/src/arithmetic/affine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl AffineArithmetic for NistP384 {
3434
///
3535
/// [SEC1]: https://www.secg.org/sec1-v2.pdf
3636
#[derive(Clone, Copy, Debug)]
37-
#[cfg_attr(docsrs, doc(cfg(feature = "arithmetic")))]
37+
#[cfg_attr(docsrs, doc(cfg(feature = "broken-arithmetic-do-not-use")))]
3838
pub struct AffinePoint {
3939
pub(crate) x: FieldElement,
4040
pub(crate) y: FieldElement,

0 commit comments

Comments
 (0)