diff --git a/.github/workflows/yescrypt.yml b/.github/workflows/yescrypt.yml index 96c92492..70241927 100644 --- a/.github/workflows/yescrypt.yml +++ b/.github/workflows/yescrypt.yml @@ -29,7 +29,7 @@ jobs: include: # 32-bit Linux - target: i686-unknown-linux-gnu - rust: 1.71.0 # MSRV + rust: 1.72.0 # MSRV deps: sudo apt update && sudo apt install gcc-multilib - target: i686-unknown-linux-gnu rust: stable @@ -37,7 +37,7 @@ jobs: # 64-bit Linux - target: x86_64-unknown-linux-gnu - rust: 1.71.0 # MSRV + rust: 1.72.0 # MSRV - target: x86_64-unknown-linux-gnu rust: stable steps: diff --git a/yescrypt/Cargo.toml b/yescrypt/Cargo.toml index 58063e6d..ba2c1255 100644 --- a/yescrypt/Cargo.toml +++ b/yescrypt/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["crypto", "hashing", "password", "phf"] categories = ["authentication", "cryptography", "no-std"] readme = "README.md" edition = "2021" -rust-version = "1.60" +rust-version = "1.72" [dependencies] libc = "0.2" diff --git a/yescrypt/README.md b/yescrypt/README.md index 0d5b18fd..e0a1cf30 100644 --- a/yescrypt/README.md +++ b/yescrypt/README.md @@ -13,7 +13,7 @@ Pure Rust implementation of the [yescrypt] password hashing function. ## Minimum Supported Rust Version -Rust **1.71** or higher. +Rust **1.72** or higher. Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump. diff --git a/yescrypt/src/lib.rs b/yescrypt/src/lib.rs index f98d6107..6731faf1 100644 --- a/yescrypt/src/lib.rs +++ b/yescrypt/src/lib.rs @@ -307,7 +307,7 @@ pub unsafe fn yescrypt_r( .wrapping_div(6), ) .wrapping_add(1); - if !(need > buflen as usize || need < saltstrlen) { + if !(need > buflen || need < saltstrlen) { if !(yescrypt_kdf( shared, local, diff --git a/yescrypt/src/salsa20.rs b/yescrypt/src/salsa20.rs index 8e68c9b9..1349cafa 100644 --- a/yescrypt/src/salsa20.rs +++ b/yescrypt/src/salsa20.rs @@ -2,7 +2,7 @@ use salsa20::cipher::Unsigned; use crate::{ common::{blkcpy, blkxor}, - size_t, uint32_t, + uint32_t, }; pub(crate) unsafe fn salsa20_2(mut B: *mut uint32_t) { diff --git a/yescrypt/src/sha256.rs b/yescrypt/src/sha256.rs index 4730f8f7..eb67b0d1 100644 --- a/yescrypt/src/sha256.rs +++ b/yescrypt/src/sha256.rs @@ -15,10 +15,7 @@ pub unsafe fn SHA256_Buf(mut in_0: *const libc::c_void, mut len: size_t, mut dig use sha2::digest::array::Array; use sha2::Digest; let mut ctx = sha2::Sha256::new(); - ctx.update(&*core::ptr::slice_from_raw_parts( - in_0 as *const u8, - len as usize, - )); + ctx.update(&*core::ptr::slice_from_raw_parts(in_0 as *const u8, len)); ctx.finalize_into(Array::from_mut_slice( &mut *core::ptr::slice_from_raw_parts_mut(digest, 32), )); @@ -34,17 +31,14 @@ pub unsafe fn HMAC_SHA256_Buf( use hmac::KeyInit; use hmac::Mac; - let key = &*core::ptr::slice_from_raw_parts(K as *const uint8_t, Klen as usize); + let key = &*core::ptr::slice_from_raw_parts(K as *const uint8_t, Klen); let mut hmac = hmac::Hmac::::new_from_slice(key) .expect("key length should always be valid with hmac"); let mut in_0 = in_0; let mut len = len; - hmac.update(&*core::ptr::slice_from_raw_parts( - in_0 as *const u8, - len as usize, - )); + hmac.update(&*core::ptr::slice_from_raw_parts(in_0 as *const u8, len)); let mac = hmac.finalize().into_bytes(); memcpy(digest as *mut _, mac.as_ptr() as *const _, 32); @@ -59,9 +53,9 @@ pub unsafe fn PBKDF2_SHA256( mut buf: *mut uint8_t, mut dkLen: size_t, ) { - let passwd = core::ptr::slice_from_raw_parts(passwd, passwdlen as usize); - let salt = core::ptr::slice_from_raw_parts(salt, saltlen as usize); - let res = core::ptr::slice_from_raw_parts_mut(buf, dkLen as usize); + let passwd = core::ptr::slice_from_raw_parts(passwd, passwdlen); + let salt = core::ptr::slice_from_raw_parts(salt, saltlen); + let res = core::ptr::slice_from_raw_parts_mut(buf, dkLen); pbkdf2::pbkdf2_hmac::(&*passwd, &*salt, c as u32, &mut *res); }