Skip to content

Commit

Permalink
Revert "p521: remove vaporware crate (#115)" (#606)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tarcieri authored Jun 12, 2022
1 parent 4a8e9d6 commit 0dd58a0
Show file tree
Hide file tree
Showing 10 changed files with 433 additions and 14 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/p521.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: p521

on:
pull_request:
paths:
- ".github/workflows/p521.yml"
- "p521/**"
- "Cargo.*"
push:
branches: master

defaults:
run:
working-directory: p521

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings"
RUSTDOCFLAGS: "-Dwarnings"

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.57.0 # MSRV
- stable
target:
- thumbv7em-none-eabi
- wasm32-unknown-unknown
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
profile: minimal
- run: cargo build --target ${{ matrix.target }} --release --no-default-features

test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
# 32-bit Linux
- target: i686-unknown-linux-gnu
rust: 1.57.0 # MSRV
deps: sudo apt update && sudo apt install gcc-multilib
- target: i686-unknown-linux-gnu
rust: stable
deps: sudo apt update && sudo apt install gcc-multilib

# 64-bit Linux
- target: x86_64-unknown-linux-gnu
rust: 1.57.0 # MSRV
- target: x86_64-unknown-linux-gnu
rust: stable

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- run: ${{ matrix.deps }}
- run: cargo check --target ${{ matrix.target }} --all-features
- run: cargo test --release --target ${{ matrix.target }} --no-default-features
- run: cargo test --release --target ${{ matrix.target }}
- run: cargo test --release --target ${{ matrix.target }} --all-features

doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: RustCrypto/actions/cargo-cache@master
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- run: cargo doc --all-features
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
target
**/Cargo.lock
*.sw*
31 changes: 19 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"k256",
"p256",
"p384",
"p521"
]

[profile.dev]
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and can be easily used for bare-metal or WebAssembly programming.
| [`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) |
| [`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) |
| [`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) |
| [`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) |

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

[//]: # (curves)

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

[//]: # (general links)
[//]: # (links)

[other-curves]: https://github.com/RustCrypto/elliptic-curves/issues/114
21 changes: 21 additions & 0 deletions p521/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "p521"
description = "NIST P-521 (secp521r1) elliptic curve"
version = "0.0.0"
authors = ["RustCrypto Developers"]
license = "Apache-2.0 OR MIT"
documentation = "https://docs.rs/elliptic-curve"
repository = "https://github.com/RustCrypto/elliptic-curves/tree/master/p521"
readme = "README.md"
edition = "2018"
categories = ["cryptography", "no-std"]
keywords = ["crypto", "ecc", "nist", "secp521r1"]

[dependencies]
elliptic-curve = { version = "0.12.1", default-features = false, features = ["hazmat", "sec1"] }

[features]
std = ["elliptic-curve/std"]

[package.metadata.docs.rs]
all-features = true
Loading

0 comments on commit 0dd58a0

Please sign in to comment.