Skip to content

Commit

Permalink
Bump elliptic-curve dependency to v0.8; ecdsa to v0.10 (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri authored Dec 17, 2020
1 parent f1324cc commit d6b04d6
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 76 deletions.
67 changes: 13 additions & 54 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions k256/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ keywords = ["bitcoin", "crypto", "ecc", "ethereum", "secp256k1"]

[dependencies]
cfg-if = "1.0"
ecdsa-core = { version = "0.10.0-pre", package = "ecdsa", optional = true, default-features = false }
elliptic-curve = { version = "=0.8.0-pre", default-features = false }
ecdsa-core = { version = "0.10", package = "ecdsa", optional = true, default-features = false }
elliptic-curve = { version = "0.8", default-features = false }
hex-literal = { version = "0.3", optional = true }
sha2 = { version = "0.9", optional = true, default-features = false }
sha3 = { version = "0.9", optional = true, default-features = false }

[dev-dependencies]
criterion = "0.3"
ecdsa-core = { version = "=0.10.0-pre", package = "ecdsa", default-features = false, features = ["dev"] }
ecdsa-core = { version = "0.10", package = "ecdsa", default-features = false, features = ["dev"] }
hex-literal = "0.3"
num-bigint = "0.3"
num-traits = "0.2"
Expand Down
16 changes: 9 additions & 7 deletions k256/src/arithmetic/affine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,15 @@ impl FromEncodedPoint<Secp256k1> for AffinePoint {

impl ToEncodedPoint<Secp256k1> for AffinePoint {
fn to_encoded_point(&self, compress: bool) -> EncodedPoint {
// TODO(tarcieri): use `EncodedPoint::conditional_select` when available
if self.infinity.into() {
// TODO(tarcieri): use `EncodedPoint::identity` when available
EncodedPoint::from_bytes(&[0]).unwrap()
} else {
EncodedPoint::from_affine_coordinates(&self.x.to_bytes(), &self.y.to_bytes(), compress)
}
EncodedPoint::conditional_select(
&EncodedPoint::from_affine_coordinates(
&self.x.to_bytes(),
&self.y.to_bytes(),
compress,
),
&EncodedPoint::identity(),
self.infinity,
)
}
}

Expand Down
6 changes: 3 additions & 3 deletions p256/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ categories = ["cryptography", "no-std"]
keywords = ["crypto", "ecc", "nist", "prime256v1", "secp256r1"]

[dependencies]
ecdsa-core = { version = "=0.10.0-pre", package = "ecdsa", optional = true, default-features = false }
elliptic-curve = { version = "=0.8.0-pre", default-features = false }
ecdsa-core = { version = "0.10", package = "ecdsa", optional = true, default-features = false }
elliptic-curve = { version = "0.8", default-features = false }
hex-literal = { version = "0.3", optional = true }
sha2 = { version = "0.9", optional = true, default-features = false }

[dev-dependencies]
ecdsa-core = { version = "=0.10.0-pre", package = "ecdsa", default-features = false, features = ["dev"] }
ecdsa-core = { version = "0.10", package = "ecdsa", default-features = false, features = ["dev"] }
hex-literal = "0.3"
proptest = "0.10"
rand_core = { version = "0.5", features = ["getrandom"] }
Expand Down
16 changes: 9 additions & 7 deletions p256/src/arithmetic/affine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,15 @@ impl FromEncodedPoint<NistP256> for AffinePoint {

impl ToEncodedPoint<NistP256> for AffinePoint {
fn to_encoded_point(&self, compress: bool) -> EncodedPoint {
// TODO(tarcieri): use `EncodedPoint::conditional_select` when available
if self.infinity.into() {
// TODO(tarcieri): use `EncodedPoint::identity` when available
EncodedPoint::from_bytes(&[0]).unwrap()
} else {
EncodedPoint::from_affine_coordinates(&self.x.to_bytes(), &self.y.to_bytes(), compress)
}
EncodedPoint::conditional_select(
&EncodedPoint::from_affine_coordinates(
&self.x.to_bytes(),
&self.y.to_bytes(),
compress,
),
&EncodedPoint::identity(),
self.infinity,
)
}
}

Expand Down
4 changes: 2 additions & 2 deletions p384/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ categories = ["cryptography", "no-std"]
keywords = ["crypto", "ecc", "nist", "secp384r1"]

[dependencies]
ecdsa = { version = "0.9", optional = true, default-features = false }
elliptic-curve = { version = "0.7", default-features = false }
ecdsa = { version = "0.10", optional = true, default-features = false }
elliptic-curve = { version = "0.8", default-features = false }
sha2 = { version = "0.9", optional = true, default-features = false }

[features]
Expand Down

0 comments on commit d6b04d6

Please sign in to comment.