Skip to content

Commit 0dd58a0

Browse files
authored
Revert "p521: remove vaporware crate (#115)" (#606)
This reverts commit 9c4a886. Revives the skeleton of a `p521` crate which was previously removed in PR #115, with the goal of turning it into a full-fledged P-521 implementation.
1 parent 4a8e9d6 commit 0dd58a0

File tree

10 files changed

+433
-14
lines changed

10 files changed

+433
-14
lines changed

.github/workflows/p521.yml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: p521
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/p521.yml"
7+
- "p521/**"
8+
- "Cargo.*"
9+
push:
10+
branches: master
11+
12+
defaults:
13+
run:
14+
working-directory: p521
15+
16+
env:
17+
CARGO_INCREMENTAL: 0
18+
RUSTFLAGS: "-Dwarnings"
19+
RUSTDOCFLAGS: "-Dwarnings"
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
rust:
27+
- 1.57.0 # MSRV
28+
- stable
29+
target:
30+
- thumbv7em-none-eabi
31+
- wasm32-unknown-unknown
32+
steps:
33+
- uses: actions/checkout@v2
34+
- uses: actions-rs/toolchain@v1
35+
with:
36+
toolchain: ${{ matrix.rust }}
37+
target: ${{ matrix.target }}
38+
override: true
39+
profile: minimal
40+
- run: cargo build --target ${{ matrix.target }} --release --no-default-features
41+
42+
test:
43+
runs-on: ubuntu-latest
44+
strategy:
45+
matrix:
46+
include:
47+
# 32-bit Linux
48+
- target: i686-unknown-linux-gnu
49+
rust: 1.57.0 # MSRV
50+
deps: sudo apt update && sudo apt install gcc-multilib
51+
- target: i686-unknown-linux-gnu
52+
rust: stable
53+
deps: sudo apt update && sudo apt install gcc-multilib
54+
55+
# 64-bit Linux
56+
- target: x86_64-unknown-linux-gnu
57+
rust: 1.57.0 # MSRV
58+
- target: x86_64-unknown-linux-gnu
59+
rust: stable
60+
61+
steps:
62+
- uses: actions/checkout@v2
63+
- uses: actions-rs/toolchain@v1
64+
with:
65+
profile: minimal
66+
toolchain: ${{ matrix.rust }}
67+
target: ${{ matrix.target }}
68+
override: true
69+
- run: ${{ matrix.deps }}
70+
- run: cargo check --target ${{ matrix.target }} --all-features
71+
- run: cargo test --release --target ${{ matrix.target }} --no-default-features
72+
- run: cargo test --release --target ${{ matrix.target }}
73+
- run: cargo test --release --target ${{ matrix.target }} --all-features
74+
75+
doc:
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/checkout@v2
79+
- uses: RustCrypto/actions/cargo-cache@master
80+
- uses: actions-rs/toolchain@v1
81+
with:
82+
toolchain: stable
83+
override: true
84+
profile: minimal
85+
- run: cargo doc --all-features

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
target
2-
**/Cargo.lock
32
*.sw*

Cargo.lock

+19-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ members = [
66
"k256",
77
"p256",
88
"p384",
9+
"p521"
910
]
1011

1112
[profile.dev]

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and can be easily used for bare-metal or WebAssembly programming.
1919
| [`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) |
2020
| [`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) |
2121
| [`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) |
22+
| [`p521`] | [NIST P-521] | 🚧 | [![crates.io](https://img.shields.io/crates/v/p521.svg)](https://crates.io/crates/p521) | [![Documentation](https://docs.rs/p521/badge.svg)](https://docs.rs/p521) | ![build](https://github.com/RustCrypto/elliptic-curves/workflows/p521/badge.svg?branch=master&event=push) |
2223

2324
NOTE: Some crates contain field/point arithmetic implementations gated under the
2425
`arithmetic` cargo feature as noted above.
@@ -63,13 +64,15 @@ dual licensed as above, without any additional terms or conditions.
6364
[`k256`]: https://github.com/RustCrypto/elliptic-curves/tree/master/k256
6465
[`p256`]: https://github.com/RustCrypto/elliptic-curves/tree/master/p256
6566
[`p384`]: https://github.com/RustCrypto/elliptic-curves/tree/master/p384
67+
[`p521`]: https://github.com/RustCrypto/elliptic-curves/tree/master/p521
6668

6769
[//]: # (curves)
6870

6971
[secp256k1]: https://en.bitcoin.it/wiki/Secp256k1
7072
[NIST P-256]: http://oid-info.com/get/1.2.840.10045.3.1.7
7173
[NIST P-384]: http://oid-info.com/get/1.3.132.0.34
74+
[NIST P-521]: http://oid-info.com/get/1.3.132.0.35
7275

73-
[//]: # (general links)
76+
[//]: # (links)
7477

7578
[other-curves]: https://github.com/RustCrypto/elliptic-curves/issues/114

p521/Cargo.toml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "p521"
3+
description = "NIST P-521 (secp521r1) elliptic curve"
4+
version = "0.0.0"
5+
authors = ["RustCrypto Developers"]
6+
license = "Apache-2.0 OR MIT"
7+
documentation = "https://docs.rs/elliptic-curve"
8+
repository = "https://github.com/RustCrypto/elliptic-curves/tree/master/p521"
9+
readme = "README.md"
10+
edition = "2018"
11+
categories = ["cryptography", "no-std"]
12+
keywords = ["crypto", "ecc", "nist", "secp521r1"]
13+
14+
[dependencies]
15+
elliptic-curve = { version = "0.12.1", default-features = false, features = ["hazmat", "sec1"] }
16+
17+
[features]
18+
std = ["elliptic-curve/std"]
19+
20+
[package.metadata.docs.rs]
21+
all-features = true

0 commit comments

Comments
 (0)