Skip to content

Commit

Permalink
Bump dependencies to new prerelease/RC crates
Browse files Browse the repository at this point in the history
Bumps the following:

- `belt-hash` v0.2.0-pre.4
- `ecdsa` v0.17.0-pre.7
- `elliptic-curve` v0.14.0-pre.6
- `hybrid-array` v0.2.0-rc.9
- `pkcs8` v0.11.0-rc.0
- `sha2` v0.11.0-pre.4
- `signature` v2.3.0-pre.4
- `sm3` v0.5.0-pre.4
  • Loading branch information
tarcieri committed Jul 27, 2024
1 parent 72540f8 commit 95272bc
Show file tree
Hide file tree
Showing 33 changed files with 149 additions and 175 deletions.
100 changes: 50 additions & 50 deletions Cargo.lock

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

20 changes: 10 additions & 10 deletions bign256/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ edition = "2021"
rust-version = "1.73"

[dependencies]
elliptic-curve = { version = "=0.14.0-pre.5", features = ["hazmat", "sec1"] }
elliptic-curve = { version = "=0.14.0-pre.6", features = ["sec1"] }

# optional dependencies
belt-hash = { version = "=0.2.0-pre.3", optional = true, default-features = false }
der = { version = "0.8.0-pre.0" }
digest = { version = "0.11.0-pre.8", optional = true }
belt-hash = { version = "=0.2.0-pre.4", optional = true, default-features = false }
der = { version = "0.8.0-rc.0" }
digest = { version = "=0.11.0-pre.9", optional = true }
hex-literal = { version = "0.4", optional = true }
hkdf = { version = "0.13.0-pre.3", optional = true }
hmac = { version = "0.13.0-pre.3", optional = true }
hkdf = { version = "=0.13.0-pre.4", optional = true }
hmac = { version = "=0.13.0-pre.4", optional = true }
rand_core = "0.6.4"
rfc6979 = { version = "=0.5.0-pre.3", optional = true }
pkcs8 = { version = "0.11.0-pre.0", optional = true }
rfc6979 = { version = "=0.5.0-pre.4", optional = true }
pkcs8 = { version = "0.11.0-rc.0", optional = true }
primeorder = { version = "=0.14.0-pre.0", optional = true, path = "../primeorder" }
sec1 = { version = "0.8.0-pre.1", optional = true }
signature = { version = "=2.3.0-pre.3", optional = true }
sec1 = { version = "0.8.0-rc.0", optional = true }
signature = { version = "=2.3.0-pre.4", optional = true }

[dev-dependencies]
criterion = "0.5"
Expand Down
3 changes: 2 additions & 1 deletion bign256/src/ecdsa/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::{BignP256, FieldBytes, NonZeroScalar, ProjectivePoint, PublicKey, Sca
use belt_hash::{BeltHash, Digest};
use core::fmt::{self, Debug};
use elliptic_curve::{
array::{consts::U32, typenum::Unsigned, Array},
array::{sizes::U32, typenum::Unsigned, Array},
ops::{MulByGenerator, Reduce},
point::AffineCoordinates,
subtle::{Choice, ConstantTimeEq},
Expand Down Expand Up @@ -101,6 +101,7 @@ impl SigningKey {
//

impl PrehashSigner<Signature> for SigningKey {
#[allow(deprecated)] // clone_from_slice
fn sign_prehash(&self, prehash: &[u8]) -> Result<Signature> {
if prehash.len() != <BignP256 as Curve>::FieldBytesSize::USIZE {
return Err(Error::new());
Expand Down
3 changes: 2 additions & 1 deletion bign256/src/ecdsa/verifying.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use belt_hash::{
BeltHash,
};
use elliptic_curve::{
array::{consts::U32, typenum::Unsigned, Array},
array::{sizes::U32, typenum::Unsigned, Array},
group::GroupEncoding,
ops::{LinearCombination, Reduce},
Curve, Field, Group,
Expand Down Expand Up @@ -107,6 +107,7 @@ impl VerifyingKey {
// `*Verifier` trait impls
//
impl PrehashVerifier<Signature> for VerifyingKey {
#[allow(deprecated)] // clone_from_slice
fn verify_prehash(&self, prehash: &[u8], signature: &Signature) -> Result<()> {
// 1. If |𝑆| != 3𝑙, return NO.
if prehash.len() != <BignP256 as Curve>::FieldBytesSize::USIZE {
Expand Down
3 changes: 2 additions & 1 deletion bign256/src/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ impl PublicKey {

/// Get [`PublicKey`] from bytes
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
let mut bytes = Array::clone_from_slice(bytes);
let mut bytes = Array::try_from(bytes).map_err(|_| Error)?;

// It is because public_key in little endian
bytes[..32].reverse();
bytes[32..].reverse();
Expand Down
1 change: 1 addition & 0 deletions bign256/src/secret_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ impl SecretKey {
/// sidechannel, always ensure that the input has been pre-padded to `C::FieldBytesSize`.
pub fn from_slice(slice: &[u8]) -> Result<Self> {
if slice.len() == <BignP256 as elliptic_curve::Curve>::FieldBytesSize::USIZE {
#[allow(deprecated)]
Self::from_bytes(FieldBytes::from_slice(slice))
} else if (Self::MIN_SIZE..<BignP256 as elliptic_curve::Curve>::FieldBytesSize::USIZE)
.contains(&slice.len())
Expand Down
6 changes: 3 additions & 3 deletions bp256/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ edition = "2021"
rust-version = "1.73"

[dependencies]
elliptic-curve = { version = "=0.14.0-pre.5", default-features = false, features = ["hazmat", "sec1"] }
elliptic-curve = { version = "=0.14.0-pre.6", default-features = false, features = ["sec1"] }

# optional dependencies
ecdsa = { version = "=0.17.0-pre.5", optional = true, default-features = false, features = ["der"] }
ecdsa = { version = "=0.17.0-pre.7", optional = true, default-features = false, features = ["der"] }
primeorder = { version = "=0.14.0-pre.0", optional = true, path = "../primeorder" }
sha2 = { version = "=0.11.0-pre.3", optional = true, default-features = false }
sha2 = { version = "=0.11.0-pre.4", optional = true, default-features = false }

[features]
default = ["pkcs8", "std"]
Expand Down
Loading

0 comments on commit 95272bc

Please sign in to comment.