From ee26f7693e18027f306cdfe52fe9324ad1130676 Mon Sep 17 00:00:00 2001 From: Bogdan Opanchuk Date: Tue, 18 May 2021 16:14:07 -0700 Subject: [PATCH] Bump RustCrypto dependencies Fixes a problem in CI with tarpaulin --- .github/workflows/umbral-pre.yml | 6 +++--- .github/workflows/workspace.yml | 2 +- umbral-pre-python/src/lib.rs | 3 --- umbral-pre/Cargo.toml | 18 +++++++++--------- umbral-pre/src/curve.rs | 5 +++-- umbral-pre/src/dem.rs | 4 ++-- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/umbral-pre.yml b/.github/workflows/umbral-pre.yml index 8d1fcc00..545e58a4 100644 --- a/.github/workflows/umbral-pre.yml +++ b/.github/workflows/umbral-pre.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: rust: - - 1.46.0 # MSRV + - 1.51.0 # MSRV - stable target: # TODO (#13): there are some build problems with `getrandom` package. @@ -47,7 +47,7 @@ jobs: include: # 32-bit Linux - target: i686-unknown-linux-gnu - rust: 1.46.0 # MSRV + rust: 1.51.0 # MSRV deps: sudo apt install gcc-multilib - target: i686-unknown-linux-gnu rust: stable @@ -55,7 +55,7 @@ jobs: # 64-bit Linux - target: x86_64-unknown-linux-gnu - rust: 1.46.0 # MSRV + rust: 1.51.0 # MSRV - target: x86_64-unknown-linux-gnu rust: stable diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index f69734d1..738cffe9 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v1 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.46.0 # MSRV + toolchain: 1.51.0 # MSRV components: clippy override: true profile: minimal diff --git a/umbral-pre-python/src/lib.rs b/umbral-pre-python/src/lib.rs index 92351389..864485be 100644 --- a/umbral-pre-python/src/lib.rs +++ b/umbral-pre-python/src/lib.rs @@ -64,9 +64,6 @@ fn hash + HasName, U: SerializableToArray>(obj: &T) }) } -// For some reason this lint is not recognized in Rust 1.46 (the one in CI) -// remove when CI is updated to a newer Rust version. -#[allow(clippy::unknown_clippy_lints)] #[allow(clippy::unnecessary_wraps)] // Don't want to wrap it in Ok() on every call fn hexstr + HasName, U: SerializableToArray>( obj: &T, diff --git a/umbral-pre/Cargo.toml b/umbral-pre/Cargo.toml index b79d1032..b0db473a 100644 --- a/umbral-pre/Cargo.toml +++ b/umbral-pre/Cargo.toml @@ -10,22 +10,22 @@ readme = "README.md" categories = ["cryptography", "no-std"] [dependencies] -k256 = { version = "0.7", default-features = false, features = ["ecdsa", "arithmetic"] } +k256 = { version = "0.8", default-features = false, features = ["ecdsa", "arithmetic"] } sha2 = "0.9" -chacha20poly1305 = { version = "0.7", features = ["xchacha20poly1305"] } -hkdf = "0.10" +chacha20poly1305 = { version = "0.8", features = ["xchacha20poly1305"] } +hkdf = "0.11" # These packages are among the dependencies of the packages above. # Their versions should be updated when the main packages above are updated. -elliptic-curve = { version = "0.8", default-features = false, features = ["digest"] } +elliptic-curve = "0.9" digest = "0.9" generic-array = "0.14" -aead = { version = "0.3", features = ["heapless"] } -ecdsa = "0.10" -signature = "1.2" -rand_core = { version = "0.5", default-features = false, features = ["getrandom"] } +aead = { version = "0.4", features = ["heapless"] } +ecdsa = "0.11" +signature = "1.3" +rand_core = { version = "0.6", default-features = false, features = ["getrandom"] } typenum = "1.13" # typenum is a 2018-edition crate starting from 1.13 -getrandom = { version = "0.1", default-features = false, features = ["wasm-bindgen"] } +getrandom = { version = "0.2", default-features = false, features = ["wasm-bindgen", "rdrand"] } subtle = { version = "2.4", default-features = false } [dev-dependencies] diff --git a/umbral-pre/src/curve.rs b/umbral-pre/src/curve.rs index d322ac63..d6d63d69 100644 --- a/umbral-pre/src/curve.rs +++ b/umbral-pre/src/curve.rs @@ -5,10 +5,11 @@ use core::default::Default; use core::ops::{Add, Mul, Sub}; use digest::Digest; +use ecdsa::hazmat::FromDigest; use elliptic_curve::ff::PrimeField; -use elliptic_curve::scalar::NonZeroScalar; use elliptic_curve::sec1::{CompressedPointSize, EncodedPoint, FromEncodedPoint, ToEncodedPoint}; -use elliptic_curve::{AffinePoint, Curve, FromDigest, ProjectiveArithmetic, Scalar}; +use elliptic_curve::NonZeroScalar; +use elliptic_curve::{AffinePoint, Curve, ProjectiveArithmetic, Scalar}; use generic_array::GenericArray; use k256::Secp256k1; use rand_core::OsRng; diff --git a/umbral-pre/src/dem.rs b/umbral-pre/src/dem.rs index e1a74607..1b4620f5 100644 --- a/umbral-pre/src/dem.rs +++ b/umbral-pre/src/dem.rs @@ -1,6 +1,6 @@ use alloc::boxed::Box; -use aead::{Aead, AeadInPlace, Payload}; +use aead::{Aead, AeadCore, Payload}; use chacha20poly1305::aead::NewAead; use chacha20poly1305::{Key, XChaCha20Poly1305, XNonce}; use generic_array::{ArrayLength, GenericArray}; @@ -47,7 +47,7 @@ pub(crate) fn kdf>( okm } -type NonceSize = ::NonceSize; +type NonceSize = ::NonceSize; pub(crate) struct DEM { cipher: XChaCha20Poly1305,