Skip to content

Commit

Permalink
k256/p256: bump ff and group deps to v0.8; MSRV 1.44+
Browse files Browse the repository at this point in the history
Previously the `elliptic-curve` crate was depending on pre-releases of
`ff` and `group` sourced via git. It was upgraded to use the final
releases in RustCrypto/traits#292.

Because these crates depend on `bitvec` and its transitive dependencies,
an `arithmetic` feature was added to `elliptic-curve` in
RustCrypto/traits#293.

This commit upgrades the `k256` and `p256` crates to use the final
releases of `ff` and `group`. This ended up actually being a relatively
straightforward upgrade because we were already running off the latest
versions sourced from git.

The major notable change is `PrimeField::ReprBits` and the `to_le_bits`
and `char_le_bits` methods for obtaining `bitvec`-friendly types for
representing field elements.
  • Loading branch information
tarcieri committed Sep 9, 2020
1 parent 4c68deb commit 7ba3f83
Show file tree
Hide file tree
Showing 22 changed files with 165 additions and 65 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/k256.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
rust:
- 1.41.0 # MSRV
- 1.44.0 # MSRV
- stable
target:
- thumbv7em-none-eabi
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
strategy:
matrix:
rust:
- 1.41.0 # MSRV
- 1.44.0 # MSRV
- stable
steps:
- uses: actions/checkout@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/p256.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
rust:
- 1.41.0 # MSRV
- 1.44.0 # MSRV
- stable
target:
- thumbv7em-none-eabi
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
matrix:
rust:
- 1.41.0 # MSRV
- 1.44.0 # MSRV
- stable
steps:
- uses: actions/checkout@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/p384.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
rust:
- 1.41.0 # MSRV
- 1.44.0 # MSRV
- stable
target:
- thumbv7em-none-eabi
Expand All @@ -49,7 +49,7 @@ jobs:
strategy:
matrix:
rust:
- 1.41.0 # MSRV
- 1.44.0 # MSRV
- stable
steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.41.0
toolchain: 1.44.0 # MSRV
components: clippy
- run: cargo clippy --all --all-features -- -D warnings

Expand Down
76 changes: 52 additions & 24 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ members = [
[patch.crates-io]
ecdsa = { git = "https://github.com/RustCrypto/signatures" }
elliptic-curve = { git = "https://github.com/RustCrypto/traits" }
group = { git = "https://github.com/zkcrypto/group.git" }
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ if you are interested in curves beyond the ones listed here.

## Minimum Supported Rust Version

All crates in this repository support Rust **1.41** or higher. In future minimum
supported Rust version can be changed, but it will be done with the minor
version bump.
All crates in this repository support Rust **1.44** or higher.

Minimum supported Rust version can be changed in the future, but it will be
done with a minor version bump.

## License

Expand All @@ -47,7 +48,7 @@ dual licensed as above, without any additional terms or conditions.

[//]: # (badges)

[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.44+-blue.svg

[//]: # (crates)

Expand Down
3 changes: 1 addition & 2 deletions k256/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ categories = ["cryptography", "cryptography::cryptocurrencies", "no-std"]
keywords = ["bitcoin", "crypto", "ecc", "ethereum", "secp256k1"]

[dependencies]
byteorder = { version = "1", default-features = false }
cfg-if = "0.1"
ecdsa-core = { version = "0.7", package = "ecdsa", optional = true, default-features = false }
elliptic-curve = { version = "0.5", default-features = false }
Expand All @@ -35,7 +34,7 @@ rand_core = { version = "0.5", features = ["getrandom"] }

[features]
default = ["arithmetic", "oid", "std"]
arithmetic = []
arithmetic = ["elliptic-curve/arithmetic"]
digest = ["elliptic-curve/digest", "ecdsa-core/digest"]
ecdh = ["elliptic-curve/ecdh", "zeroize"]
ecdsa = ["arithmetic", "digest", "ecdsa-core/sign", "ecdsa-core/verify", "zeroize"]
Expand Down
4 changes: 2 additions & 2 deletions k256/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ particularly in conjunction with the

## Minimum Supported Rust Version

Rust **1.41** or higher.
Rust **1.44** or higher.

Minimum supported Rust version can be changed in the future, but it will be
done with a minor version bump.
Expand Down Expand Up @@ -84,7 +84,7 @@ dual licensed as above, without any additional terms or conditions.
[docs-image]: https://docs.rs/k256/badge.svg
[docs-link]: https://docs.rs/k256/
[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.41+-blue.svg
[rustc-image]: https://img.shields.io/badge/rustc-1.44+-blue.svg
[build-image]: https://github.com/RustCrypto/elliptic-curves/workflows/k256/badge.svg?branch=master&event=push
[build-link]: https://github.com/RustCrypto/elliptic-curves/actions?query=workflow%3Ak256

Expand Down
1 change: 1 addition & 0 deletions k256/src/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub(crate) const CURVE_EQUATION_B: FieldElement = FieldElement::from_bytes_unche
impl elliptic_curve::Arithmetic for Secp256k1 {
type Scalar = Scalar;
type AffinePoint = AffinePoint;
type ProjectivePoint = ProjectivePoint;
}

#[cfg(test)]
Expand Down
Loading

0 comments on commit 7ba3f83

Please sign in to comment.